@Test public void chmod_octet() { res = vrouter.info(); assertTrue(res.getErrorMessage(), !res.isError()); res = vrouter.chmod(640); assertTrue(res.getErrorMessage(), !res.isError()); res = vrouter.info(); assertTrue(res.getErrorMessage(), !res.isError()); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_M").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_A").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_M").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_A").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_U").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_M").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_A").equals("0")); res = vrouter.chmod("147"); assertTrue(res.getErrorMessage(), !res.isError()); res = vrouter.info(); assertTrue(res.getErrorMessage(), !res.isError()); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_U").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_M").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_A").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_M").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_A").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_M").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_A").equals("1")); }
@Test public void chmod() { res = vrouter.info(); assertTrue(res.getErrorMessage(), !res.isError()); String owner_a = vrouter.xpath("PERMISSIONS/OWNER_A"); String group_a = vrouter.xpath("PERMISSIONS/GROUP_A"); res = vrouter.chmod(0, 1, -1, 1, 0, -1, 1, 1, 0); assertTrue(res.getErrorMessage(), !res.isError()); res = vrouter.info(); assertTrue(res.getErrorMessage(), !res.isError()); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_U").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_M").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OWNER_A").equals(owner_a)); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_M").equals("0")); assertTrue(vrouter.xpath("PERMISSIONS/GROUP_A").equals(group_a)); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_U").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_M").equals("1")); assertTrue(vrouter.xpath("PERMISSIONS/OTHER_A").equals("0")); }