#!/usr/bin/python from sys import exit from os.path import join as path_join, dirname from test_tools import executeAndCompare class TestNuperiod: def __init__(self): self.program = "/usr/sbin/nuperiod" self.output_filename = "/tmp/period.xml" self.rootdir = dirname(__file__) def testFile(self, filename, valid): print "* Test nupyf with %s" % filename filename = path_join(self.rootdir, filename) valid = path_join(self.rootdir, valid) cmd = "%s -f %s > %s" % (self.program, filename, self.output_filename) ok = executeAndCompare(cmd, valid, self.output_filename) if ok: print "[OK]" else: print "[FAILURE]" return ok def main(self): ok = self.testFile("period_acl.xml", "period_result.xml") if ok: exit(0) else: exit(1) if __name__ == "__main__": TestNuperiod().main()