File: check-selinux-installation

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 (36 lines) | stat: -rwxr-xr-x 604 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
import os, glob
testsdir="/usr/share/selinux-basics/tests"

tests = []

def register_test(test):
	tests.append(test)

class ErrorBase:
	def __str__(self):
		raise "Error with no description found. Class: %s" % self.__class__
	def fixable(self):
		return False
	def fix(self):
		return False

class TestBase:
	@staticmethod
	def test():
		return []

	def fix():
		pass

testfiles = glob.glob(os.path.join(testsdir,"[0-9]*.py"))
testfiles.sort()
for testfile in testfiles:
	execfile(testfile)

results = []
for test in tests:
	results += test.test()

for result in results:
	print result