bundled_image_reservation = self.tester.run_instance( **self.run_instance_params) for new_instance in bundled_image_reservation.instances: new_instance.sys("ls " + temp_file, code=0) self.tester.terminate_instances(bundled_image_reservation) self.run_instance_params['image'] = original_image if __name__ == "__main__": testcase = EutesterTestCase(name='instancetest') testcase.setup_parser( description= "Test the Eucalyptus EC2 instance store image functionality.") testcase.get_args() instancetestsuite = testcase.do_with_args(InstanceBasics) ### Either use the list of tests passed from config/command line to determine what subset of tests to run test_list = testcase.args.tests or [ "BasicInstanceChecks", "DNSResolveCheck", "Reboot", "MetaData", "ElasticIps", "MultipleInstances", "LargestInstance", "PrivateIPAddressing", "Churn" ] ### Convert test suite methods to EutesterUnitTest objects unit_list = [] for test in test_list: test = getattr(instancetestsuite, test) unit_list.append(testcase.create_testunit_from_method(test)) testcase.clean_method = instancetestsuite.clean_method result = testcase.run_test_case_list(unit_list) exit(result)
testcase.parser.add_argument('--snap_count', type=int, help='Number of snapshots to create per zone',default=5) testcase.parser.add_argument('--snap_delay', type=int, help='Delay in seconds between each snapshot created',default=0) testcase.parser.add_argument('--snap_progress', type=int, help='Number of 10 second polls to allow without increase in snapshot progress',default=60) testcase.parser.add_argument('--timepergig', type=int, help='Time allowed per gig size of volume during volume creation',default=300) testcase.parser.add_argument('--snap_attached', dest='snap_attached', action='store_true', default=False) testcase.parser.add_argument('--delete_to', type=int, help="Timeout for volume deletion", default=120) testcase.parser.add_argument('--root_device_type', help="Type of instance to run, 'ebs' or 'instance-store'", default='instance-store') #Get arguments passed in through cli and/or config file(s), these will be stored in testcase.args testcase.get_args() #create the EbsTestSuite object, use 'do_with_args' to auto populate the object's init with testcase.args ebstestsuite= testcase.do_with_args(EbsTestSuite) #register a test cleanup method with the testcase... testcase.clean_method = ebstestsuite.clean_created_resources #add test methods and their arguments to be run to a list... testlist = ebstestsuite.test_consecutive_concurrent(run=False, count=int(testcase.args.snap_count), delay=testcase.args.snap_delay, tpg=testcase.args.timepergig, snap_attached = testcase.args.snap_attached, delete_to = testcase.args.delete_to, poll_progress=testcase.args.snap_progress) #finally, execute the list of test methods from the test case wrapper... ret = testcase.run_test_case_list(testlist) print "ebs_extended_test exiting:("+str(ret)+")" exit(ret)
if __name__ == "__main__": ## If given command line arguments, use them as test names to launch testcase= EutesterTestCase(name='multi_node_churn') testcase.setup_parser(description="Attempts to test and provide info on focused areas related to Eucalyptus EBS related functionality.", testlist=False) testcase.parser.add_argument('--count', type=int, help='Number of times to run attach/detach churn',default=None) testcase.parser.add_argument('--nodecount', type=int, help='Number of nodes in env',default=None) testcase.parser.add_argument('--fof', dest='fof', help="Freeze test on fail, do not remove or tear down test items",action='store_true', default=None) testcase.get_args() count = testcase.args.count or 10 fof = testcase.args.fof if testcase.args.fof is not None else False nodecount = testcase.args.nodecount or 2 ebstestsuite= testcase.do_with_args(EbsTestSuite) if testcase.args.fof: testcase.clean_method = lambda: testcase.status("Freeze on fail flag is set, not cleaning!") else: testcase.clean_method = ebstestsuite.clean_created_resources testlist = ebstestsuite.test_multi_node(run=False, count=int(count), nodecount=int(nodecount)) ret = testcase.run_test_case_list(testlist) print "mutli node test exiting:("+str(ret)+")" exit(ret)
instance.sys('ls -la', code=0) not_rebooted_image = self.tester.create_image(instance, "BFEBS-test-create-image-noreboot-" + current_time, no_reboot=True) ending_uptime = instance.get_uptime() if ending_uptime < starting_uptime: raise Exception("Instance did get stopped then started when it shouldn't have") self.run_instance_params['image'] = not_rebooted_image new_image_reservation = self.tester.run_instance(**self.run_instance_params) for new_instance in new_image_reservation.instances: ## Check that our temp file exists new_instance.sys("ls -la") new_instance.sys("ls " + temp_file, code=0) self.tester.terminate_instances(new_image_reservation) if __name__ == "__main__": testcase= EutesterTestCase(name='bfebstest') testcase.setup_parser(description="Test the Eucalyptus EC2 BFEBS image functionality.") testcase.parser.add_argument('--imgurl', help="BFEBS Image to splat down", default=None) testcase.get_args() bfebstestsuite = testcase.do_with_args(BFEBSBasics) ### Either use the list of tests passed from config/command line to determine what subset of tests to run list = testcase.args.tests or ["RegisterImage", "StopStart", "MultipleBFEBSInstances"] ### Convert test suite methods to EutesterUnitTest objects unit_list = [] for test in list: test = getattr(bfebstestsuite,test) unit_list.append(testcase.create_testunit_from_method(test)) testcase.clean_method = bfebstestsuite.clean_method result = testcase.run_test_case_list(unit_list) exit(result)
'--count', type=int, help='Number of times to run attach/detach churn', default=None) testcase.parser.add_argument('--nodecount', type=int, help='Number of nodes in env', default=None) testcase.parser.add_argument( '--fof', dest='fof', help="Freeze test on fail, do not remove or tear down test items", action='store_true', default=None) testcase.get_args() count = testcase.args.count or 10 fof = testcase.args.fof if testcase.args.fof is not None else False nodecount = testcase.args.nodecount or 2 ebstestsuite = testcase.do_with_args(EbsTestSuite) if testcase.args.fof: testcase.clean_method = lambda: testcase.status( "Freeze on fail flag is set, not cleaning!") else: testcase.clean_method = ebstestsuite.clean_created_resources testlist = ebstestsuite.test_multi_node(run=False, count=int(count), nodecount=int(nodecount)) ret = testcase.run_test_case_list(testlist) print "mutli node test exiting:(" + str(ret) + ")" exit(ret)
type=int, help="Timeout for volume deletion", default=180) testcase.parser.add_argument( '--root_device_type', help="Type of instance to run, 'ebs' or 'instance-store'", default='instance-store') #Get arguments passed in through cli and/or config file(s), these will be stored in testcase.args testcase.get_args() #create the EbsTestSuite object, use 'do_with_args' to auto populate the object's init with testcase.args ebstestsuite = testcase.do_with_args(EbsTestSuite) #register a test cleanup method with the testcase... testcase.clean_method = ebstestsuite.clean_created_resources #add test methods and their arguments to be run to a list... testlist = ebstestsuite.test_consecutive_concurrent( run=False, count=int(testcase.args.snap_count), delay=testcase.args.snap_delay, tpg=testcase.args.timepergig, snap_attached=testcase.args.snap_attached, delete_to=testcase.args.delete_to, poll_progress=testcase.args.snap_progress) #finally, execute the list of test methods from the test case wrapper... ret = testcase.run_test_case_list(testlist) print "ebs_extended_test exiting:(" + str(ret) + ")" exit(ret)
prev_address = None if self.reservation: self.tester.terminate_instances(self.reservation) self.set_reservation(None) for i in xrange(5): reservation = self.tester.run_instance(**self.run_instance_params) for instance in reservation.instances: if prev_address is not None: self.assertTrue(re.search(str(prev_address) ,str(instance.ip_address)), str(prev_address) +" Address did not get reused but rather " + str(instance.public_dns_name)) prev_address = instance.ip_address self.tester.terminate_instances(reservation) if __name__ == "__main__": testcase= EutesterTestCase(name='instancetest') testcase.setup_parser(description="Test the Eucalyptus EC2 instance store image functionality.") testcase.get_args() instancetestsuite= testcase.do_with_args(InstanceBasics) ### Either use the list of tests passed from config/command line to determine what subset of tests to run list = testcase.args.tests or [ "BasicInstanceChecks", "DNSResolveCheck", "Reboot", "MetaData", "ElasticIps", "MultipleInstances", "LargestInstance", "PrivateIPAddressing", "Churn"] ### Convert test suite methods to EutesterUnitTest objects unit_list = [] for test in list: test = getattr(instancetestsuite,test) unit_list.append(testcase.create_testunit_from_method(test)) testcase.clean_method = instancetestsuite.clean_method result = testcase.run_test_case_list(unit_list) exit(result)