## If given command line arguments, use them as test names to launch parser = argparse.ArgumentParser( prog='ststest.py', version='Test Case [ststest.py] Version 0.1', description='''Test token service functionality and features on a Eucalyptus Cloud.''', usage= "%(prog)s --credpath=<path to creds> [--xml] [--tests=test1,..testN]") parser.add_argument('--credpath', help="path to user credentials", default=".eucarc") parser.add_argument('--xml', help="to provide JUnit style XML output", action="store_true", default=False) parser.add_argument('--tests', nargs='+', help="test cases to be executed", default=['testIssueToken']) args = parser.parse_args() arg_credpath = args.credpath for test in args.tests: if args.xml: file = open("test-" + test + "result.xml", "w") result = xmlrunner.XMLTestRunner(file).run(StsUI(test)) else: result = unittest.TextTestRunner(verbosity=2).run(StsUI(test)) if result.wasSuccessful(): pass else: exit(1)
action="store_true", default=False) parser.add_argument('--tests', nargs='+', help="test cases to be executed", default=[ "BasicInstanceChecks", "ElasticIps", "PrivateIPAddressing", "MaxSmallInstances", "LargestInstance", "MetaData", "DNSResolveCheck", "DNSCheck" "Reboot", "Churn" ]) args = parser.parse_args() arg_credpath = args.credpath for test in args.tests: if args.xml: try: os.mkdir("results") except OSError: pass file = open("results/test-" + test + "result.xml", "w") result = xmlrunner.XMLTestRunner(file).run(InstanceBasics(test)) file.close() else: result = unittest.TextTestRunner(verbosity=2).run( InstanceBasics(test)) if result.wasSuccessful(): pass else: exit(1)
raise e if result.wasSuccessful(): self.tester.debug("Passed test: " + testcase) queue.put(0) else: self.tester.debug("Failed test: " + testcase) queue.put(1) if __name__ == "__main__": ## If given command line arguments, use them as test names to launch parser = argparse.ArgumentParser(description='Parse test suite arguments.') parser.add_argument('--xml', action="store_true", default=False) parser.add_argument('--tests', nargs='+', default= ["RegisterImage","LaunchImage", "StopStart","MultipleBFEBSInstances","ChurnBFEBS"]) args = parser.parse_args() for test in args.tests: if args.xml: try: os.mkdir("results") except OSError: pass file = open("results/test-" + test + "result.xml", "w") result = xmlrunner.XMLTestRunner(file).run(BFEBSBasics(test)) file.close() else: result = unittest.TextTestRunner(verbosity=2).run(BFEBSBasics(test)) if result.wasSuccessful(): pass else: exit(1)
for i in xrange(count): key_name = "key-generator-" + str(i) keypair = self.tester.add_keypair() self.tester.delete_keypair(keypair) def GenerateVolumes(self, count=10): """ Create and delete volumes in series """ for i in xrange(count): volume = self.tester.create_volume(self.zone) self.tester.delete_volume(volume) if __name__ == "__main__": ## If given command line arguments, use them as test names to launch parser = argparse.ArgumentParser(description='Parse test suite arguments.') parser.add_argument('--xml', action="store_true", default=False) parser.add_argument('--tests', nargs='+', default=["GenerateKeypairs"]) args = parser.parse_args() for test in args.tests: if args.xml: file = open("test-" + test + "result.xml", "w") result = xmlrunner.XMLTestRunner(file).run(LoadGenerator(test)) else: result = unittest.TextTestRunner(verbosity=2).run( LoadGenerator(test)) if result.wasSuccessful(): pass else: exit(1)
parser.add_argument('--xml', action="store_true", default=False) parser.add_argument('--tests', nargs='+', default=[ "CanonicalizedAmzNullHeaders", "CanonicalizedAmzCommaHeaders", "CanonicalizedAmzSeparateHeaders", "CanonicalizedAmzSeparateHeadersBroken" ]) parser.add_argument('unittest_args', nargs='*') ## Grab arguments passed via commandline options = parser.parse_args() sys.argv[1:] = options.unittest_args return options if __name__ == "__main__": ## If given command line arguments, use them as test names to launch options = get_options() for test in options.tests: if options.xml: file = open("test-" + test + "result.xml", "w") result = xmlrunner.XMLTestRunner(file).run(WalrusBasics(test)) else: result = unittest.TextTestRunner(verbosity=2).run( WalrusBasics(test)) if result.wasSuccessful(): pass else: exit(1)