summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2012-10-15 13:32:14 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-10-15 13:32:14 -0500
commitca1237602fff7678041e8c338b067453c267712d (patch)
treeafc30aa6af60355fe7dde700a26fba71bf7ec372 /testsuite/Testsrc
parentcc4b4e645158f26313a306b0f445987164a2e472 (diff)
downloadbcfg2-ca1237602fff7678041e8c338b067453c267712d.tar.gz
bcfg2-ca1237602fff7678041e8c338b067453c267712d.tar.bz2
bcfg2-ca1237602fff7678041e8c338b067453c267712d.zip
POSIX: Switch from perms to mode
Bcfg2 has traditionally used the 'perms' attribute to specify the file mode for POSIX entries. Switching to a 'mode' attribute will allow us to be more consistent with other tools as well as POSIX itself. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'testsuite/Testsrc')
-rw-r--r--testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py b/testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py
index 39c0b02d0..332722074 100644
--- a/testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py
+++ b/testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py
@@ -205,7 +205,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
entry = lxml.etree.Element("Path", name="/etc/foo", owner="owner",
- group="group", perms="644", type="file")
+ group="group", mode="644", type="file")
mock_norm_uid.return_value = 10
mock_norm_gid.return_value = 100
@@ -215,7 +215,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with(entry.get("name"), 10, 100)
mock_chmod.assert_called_with(entry.get("name"),
- int(entry.get("perms"), 8))
+ int(entry.get("mode"), 8))
self.assertFalse(mock_utime.called)
mock_set_secontext.assert_called_with(entry, path=entry.get("name"))
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
@@ -228,7 +228,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with(entry.get("name"), 10, 100)
mock_chmod.assert_called_with(entry.get("name"),
- int(entry.get("perms"), 8))
+ int(entry.get("mode"), 8))
mock_utime.assert_called_with(entry.get("name"), (mtime, mtime))
mock_set_secontext.assert_called_with(entry, path=entry.get("name"))
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
@@ -238,7 +238,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_uid.assert_called_with(entry)
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with('/etc/bar', 10, 100)
- mock_chmod.assert_called_with('/etc/bar', int(entry.get("perms"), 8))
+ mock_chmod.assert_called_with('/etc/bar', int(entry.get("mode"), 8))
mock_utime.assert_called_with(entry.get("name"), (mtime, mtime))
mock_set_secontext.assert_called_with(entry, path='/etc/bar')
mock_set_acls.assert_called_with(entry, path='/etc/bar')
@@ -258,7 +258,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with(entry.get("name"), 0, 0)
mock_chmod.assert_called_with(entry.get("name"),
- int(entry.get("perms"), 8) | list(device_map.values())[0])
+ int(entry.get("mode"), 8) | list(device_map.values())[0])
mock_utime.assert_called_with(entry.get("name"), (mtime, mtime))
mock_set_secontext.assert_called_with(entry, path=entry.get("name"))
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
@@ -274,7 +274,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with(entry.get("name"), 10, 100)
mock_chmod.assert_called_with(entry.get("name"),
- int(entry.get("perms"), 8))
+ int(entry.get("mode"), 8))
mock_utime.assert_called_with(entry.get("name"), (mtime, mtime))
mock_set_secontext.assert_called_with(entry, path=entry.get("name"))
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
@@ -292,7 +292,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_norm_gid.assert_called_with(entry)
mock_chown.assert_called_with(entry.get("name"), 10, 100)
mock_chmod.assert_called_with(entry.get("name"),
- int(entry.get("perms"), 8))
+ int(entry.get("mode"), 8))
mock_utime.assert_called_with(entry.get("name"), (mtime, mtime))
mock_set_secontext.assert_called_with(entry, path=entry.get("name"))
mock_set_acls.assert_called_with(entry, path=entry.get("name"))
@@ -624,7 +624,7 @@ class TestPOSIXTool(Bcfg2TestCase):
mock_gather_data, mock_verify_acls,
mock_matchpathcon):
entry = lxml.etree.Element("Path", name="/test", type="file",
- group="group", owner="user", perms="664",
+ group="group", owner="user", mode="664",
secontext='etc_t')
# _verify_metadata() mutates the entry, so we keep a backup so we
# can start fresh every time
@@ -646,7 +646,7 @@ class TestPOSIXTool(Bcfg2TestCase):
# expected data. tuple of attr, return value index, value
expected = [('current_owner', 1, '0'),
('current_group', 2, '10'),
- ('current_perms', 3, '0664'),
+ ('current_mode', 3, '0664'),
('current_secontext', 4, 'etc_t')]
mock_norm_uid.return_value = 0
mock_norm_gid.return_value = 10
@@ -702,7 +702,7 @@ class TestPOSIXTool(Bcfg2TestCase):
# return value index, new (failing) value
failures = [('current_owner', 1, '10'),
('current_group', 2, '100'),
- ('current_perms', 3, '0660')]
+ ('current_mode', 3, '0660')]
if HAS_SELINUX:
failures.append(('current_secontext', 4, 'root_t'))