bad_file_permissions check: Use correct filename
This bumps test coverage of general_bad_file_permissions from 33% to 93%. Change-Id: I3a1b7be042fc8b34e99bd3b9564893d7d993dbca
This commit is contained in:
parent
39b5fed624
commit
38ac37ce65
@ -3,7 +3,6 @@ import stat
|
||||
|
||||
keyfile = 'foo'
|
||||
|
||||
os.chmod('/etc/passwd', 0777)
|
||||
os.chmod('/etc/passwd', 0227)
|
||||
os.chmod('/etc/passwd', 07)
|
||||
os.chmod('/etc/passwd', 0664)
|
||||
|
@ -181,17 +181,13 @@ class FunctionalTests(testtools.TestCase):
|
||||
filename = 'os-chmod-{}.py'
|
||||
if six.PY2:
|
||||
filename = filename.format('py2')
|
||||
expect = {
|
||||
'SEVERITY': {'MEDIUM': 2, 'HIGH': 9},
|
||||
'CONFIDENCE': {'HIGH': 10, 'MEDIUM': 1}
|
||||
}
|
||||
else:
|
||||
filename = filename.format('py3')
|
||||
expect = {
|
||||
'SEVERITY': {'MEDIUM': 2, 'HIGH': 9},
|
||||
'CONFIDENCE': {'HIGH': 10, 'MEDIUM': 1}
|
||||
}
|
||||
self.check_example('os-chmod.py', expect)
|
||||
expect = {
|
||||
'SEVERITY': {'MEDIUM': 2, 'HIGH': 8},
|
||||
'CONFIDENCE': {'MEDIUM': 1, 'HIGH': 9}
|
||||
}
|
||||
self.check_example(filename, expect)
|
||||
|
||||
def test_os_exec(self):
|
||||
'''Test for `os.exec*`.'''
|
||||
|
Loading…
Reference in New Issue
Block a user