Пример #1
0
class snapshot(unittest.TestCase):
    def setUp(self):
        self.configfile = sys.argv[1]
        self.utils = Utils()
        self.all_config = self.utils.init_allconfig(self.configfile)

        self.utils.deploy_usx(self.all_config)

        self.amc_ip = self.all_config['amc_ip']
        self.tests = Ha(self.configfile)
        self.tools = Tools(self.amc_ip)

    def tearDown(self):
        clean_testbed_op = ["clean_testbed:"]
        self.tests._exec(clean_testbed_op)
        print("done!!!!!!!!!!!!")

    def snapshot(self):
        volume_type_list = self.tests._get_volume_type_list_from_config()
        for volume_type in volume_type_list:
            self.assertEqual(self.test_snapshot(volume_type), True)
  #      self.assertEqual(self.test_snapshot('simplememory'), True)

    def test_snapshot(self, volume):

        daily_schedule_snapshot_op = ["create_daily_schedule_snapshot:'vols'[" + volume + "][0]:"]
        self.tests._exec(daily_schedule_snapshot_op)
        
        check_snapshot_by_lvs_op = ["check_snapshot_by_lvs:'vols'[" + volume + "][0]:"]
        self.tests._exec(check_snapshot_by_lvs_op)

        check_snapshot_number_op = ["check_snapshot_number:'vols'[" + volume + "][0]:1"]
        return self.tests._exec(check_snapshot_number_op)
Пример #2
0
class delete(unittest.TestCase):

    def setUp(self):
        self.configfile = sys.argv[1]
        self.utils = Utils()
        self.all_config = self.utils.init_allconfig(self.configfile)

        self.utils.deploy_usx(self.all_config)

        self.amc_ip = self.all_config['amc_ip']
        self.tests = Ha(self.configfile)
        self.tools = Tools(self.amc_ip)

    def tearDown(self):
        # clean_testbed_op = ["clean_testbed:amc_ip"]
        # self.tests._exec(clean_testbed_op)
        print("done!!!!!!!!!!!!")

    def delete(self):
        self.assertEqual(self.stretch('hybrid'), True)
 #       self.assertEqual(self.stretch('flash'), True)
        #self.assertEqual(self.stretch('memory'), True)
        # self.assertEqual(self.stretch('hyperconverge'), True)

    def stretch(self, volume):
        return True
        enable_ha_op = ["enable_ha:'vols'[" + volume + "]:"]
        # self.tests._exec(enable_ha_op)

        # disable_ha_op = ["disable_ha:'vols'[" + volume + "]:"]
        # self.tests._exec(disable_ha_op)

        mount_op = ["mount_vol:'vols'[" + volume + "]:"]
       # self.tests._exec(mount_op)

        clone_op = ["clone_vm:'vols'[" + volume + "][0]:"]
       # self.tests._exec(clone_op)

        # sync_op = ["sync_vm:"]
        # self.tests._exec(sync_op)

        # for x in range(2):
        failover_op = ["failover_case:'vols'[" + volume + "]:"]
        # self.tests._exec(failover_op)

        # check_crm_op = ["verifyCrm:'vols'[" + volume + "]:"]
        # return self.tests._exec(check_crm_op)
        return True