File: 02_verify_slash_selinux.py

package info (click to toggle)
selinux-basics 0.5.0
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 140 kB
  • sloc: python: 279; sh: 217; perl: 43; makefile: 26
file content (20 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class TestSlashSELinux(TestBase):
	"""
	Verify that /selinux is present
	"""
	class ErrorNoSlashSELinux(ErrorBase):
		def __str__(self):
			return "The directory /selinux is missing."
		def fixable(self):
			return True
		def fix(self):
			import os
			return os.mkdir("/selinux")

	@staticmethod
	def test():
		import os
		if not os.access("/selinux",os.F_OK):
			return [TestSlashSELinux.ErrorNoSlashSELinux()]
		return []
register_test(TestSlashSELinux)