File: 02_verify_slash_selinux.py

package info (click to toggle)
selinux-basics 0.3.0
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 104 kB
  • ctags: 79
  • sloc: python: 316; sh: 115; makefile: 45
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)