def test_vmss_disable_single_placement_group(self): # default is enable single-placement-group ns = argparse.Namespace() self._set_up_ns(ns) _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, None) # disable on any zonal scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.zones = ['1'] _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # disable on any big scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.instance_count = 101 _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # disable on zonal + fd count ns = argparse.Namespace() self._set_up_ns(ns) ns.platform_fault_domain_count = 1 ns.zones = ['1'] _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # error on conflicts # can't enable it with zonal scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.zones = ['1'] ns.single_placement_group = True self.assertRaises(CLIError, _validate_vmss_single_placement_group, ns) # can't enable it with big scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.instance_count = 101 ns.single_placement_group = True self.assertRaises(CLIError, _validate_vmss_single_placement_group, ns)
def test_vmss_disable_single_placement_group(self): # default is enable single-placement-group ns = argparse.Namespace() self._set_up_ns(ns) _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, None) # disable on any zonal scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.zones = ['1'] _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # disable on any big scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.instance_count = 101 _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # disable on zonal + fd count ns = argparse.Namespace() self._set_up_ns(ns) ns.platform_fault_domain_count = 1 ns.zones = ['1'] _validate_vmss_single_placement_group(ns) self.assertEqual(ns.single_placement_group, False) # error on conflicts # can't enable it with zonal scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.zones = ['1'] ns.single_placement_group = True self.assertRaises(CLIError, _validate_vmss_single_placement_group, ns) # can't enable it with big scale-set ns = argparse.Namespace() self._set_up_ns(ns) ns.instance_count = 101 ns.single_placement_group = True self.assertRaises(CLIError, _validate_vmss_single_placement_group, ns)