def test_lan_already_top_priority(self): boot_profile_response = make_fake_result('configResolveChildren', 'lsbootLan') mock = self.patch(ucsm, 'get_first_booter') mock.return_value = boot_profile_response[0] change = make_policy_change(boot_profile_response) self.assertIsNone(change) self.assertThat(mock, MockCalledOnceWith(boot_profile_response))
def test_change_lan_to_top_priority(self): boot_profile_response = Element('outConfigs') lan_boot = Element('lsbootLan', {'order': 'second'}) storage_boot = Element('lsbootStorage', {'order': 'first'}) boot_profile_response.extend([lan_boot, storage_boot]) self.patch(ucsm, 'get_first_booter').return_value = storage_boot self.patch(ucsm, 'strip_ro_keys') change = make_policy_change(boot_profile_response) lan_boot_order = change.xpath('//lsbootPolicy/lsbootLan/@order') storage_boot_order = \ change.xpath('//lsbootPolicy/lsbootStorage/@order') self.assertEqual(['first'], lan_boot_order) self.assertEqual(['second'], storage_boot_order)
def test_change_lan_to_top_priority(self): boot_profile_response = Element("outConfigs") lan_boot = Element("lsbootLan", {"order": "second"}) storage_boot = Element("lsbootStorage", {"order": "first"}) boot_profile_response.extend([lan_boot, storage_boot]) self.patch(ucsm, "get_first_booter").return_value = storage_boot self.patch(ucsm, "strip_ro_keys") change = make_policy_change(boot_profile_response) lan_boot_order = change.xpath("//lsbootPolicy/lsbootLan/@order") storage_boot_order = change.xpath( "//lsbootPolicy/lsbootStorage/@order") self.assertEqual(["first"], lan_boot_order) self.assertEqual(["second"], storage_boot_order)