mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Update comments in minitools_test.py
After switching to winbindd as test profile, comments about the ntpd profile don't make sense anymore ;-) The patch also includes a whitespace fix. Acked-by: Kshitij Gupta <kgupta8592@gmail.com> Acked-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
This commit is contained in:
parent
c950c2a358
commit
9c6fae0c02
1 changed files with 8 additions and 8 deletions
|
@ -33,21 +33,21 @@ if sys.version_info >= (3, 0):
|
|||
class Test(unittest.TestCase):
|
||||
|
||||
def test_audit(self):
|
||||
#Set ntpd profile to audit mode and check if it was correctly set
|
||||
# Set test profile to audit mode and check if it was correctly set
|
||||
str(subprocess.check_output('%s ./../aa-audit --no-reload -d ./profiles %s'%(python_interpreter, test_path), shell=True))
|
||||
|
||||
self.assertEqual(apparmor.get_profile_flags(local_profilename, test_path), 'audit', 'Audit flag could not be set in profile %s'%local_profilename)
|
||||
|
||||
#Remove audit mode from ntpd profile and check if it was correctly removed
|
||||
# Remove audit mode from test profile and check if it was correctly removed
|
||||
subprocess.check_output('%s ./../aa-audit --no-reload -d ./profiles -r %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
self.assertEqual(apparmor.get_profile_flags(local_profilename, test_path), None, 'Audit flag could not be removed in profile %s'%local_profilename)
|
||||
|
||||
|
||||
def test_complain(self):
|
||||
#Set ntpd profile to complain mode and check if it was correctly set
|
||||
# Set test profile to complain mode and check if it was correctly set
|
||||
subprocess.check_output('%s ./../aa-complain --no-reload -d ./profiles %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
|
||||
# "manually" create a force-complain symlink (will be deleted by aa-enforce later)
|
||||
if not os.path.isdir('./profiles/force-complain'):
|
||||
os.mkdir('./profiles/force-complain')
|
||||
|
@ -56,7 +56,7 @@ class Test(unittest.TestCase):
|
|||
self.assertEqual(os.path.islink('./profiles/force-complain/%s'%os.path.basename(local_profilename)), True, 'Failed to create a symlink for %s in force-complain'%local_profilename)
|
||||
self.assertEqual(apparmor.get_profile_flags(local_profilename, test_path), 'complain', 'Complain flag could not be set in profile %s'%local_profilename)
|
||||
|
||||
#Set ntpd profile to enforce mode and check if it was correctly set
|
||||
# Set test profile to enforce mode and check if it was correctly set
|
||||
subprocess.check_output('%s ./../aa-enforce --no-reload -d ./profiles %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
self.assertEqual(os.path.islink('./profiles/force-complain/%s'%os.path.basename(local_profilename)), False, 'Failed to remove symlink for %s from force-complain'%local_profilename)
|
||||
|
@ -83,9 +83,9 @@ class Test(unittest.TestCase):
|
|||
subprocess.check_output('%s ./../aa-audit --no-reload -d ./profiles -r %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
def test_enforce(self):
|
||||
#Set ntpd profile to complain mode and check if it was correctly set
|
||||
# Set test profile to complain mode and check if it was correctly set
|
||||
|
||||
#Set ntpd profile to enforce mode and check if it was correctly set
|
||||
# Set test profile to enforce mode and check if it was correctly set
|
||||
subprocess.check_output('%s ./../aa-enforce --no-reload -d ./profiles %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
self.assertEqual(os.path.islink('./profiles/force-complain/%s'%os.path.basename(local_profilename)), False, 'Failed to remove symlink for %s from force-complain'%local_profilename)
|
||||
|
@ -94,7 +94,7 @@ class Test(unittest.TestCase):
|
|||
|
||||
|
||||
def test_disable(self):
|
||||
#Disable the ntpd profile and check if it was correctly disabled
|
||||
# Disable the test profile and check if it was correctly disabled
|
||||
subprocess.check_output('%s ./../aa-disable --no-reload -d ./profiles %s'%(python_interpreter, test_path), shell=True)
|
||||
|
||||
self.assertEqual(os.path.islink('./profiles/disable/%s'%os.path.basename(local_profilename)), True, 'Failed to create a symlink for %s in disable'%local_profilename)
|
||||
|
|
Loading…
Add table
Reference in a new issue