def test_configure_ipxe_boot_not_installed(self, zboot):
     boot_url = "some.url"
     instance = ZerobootIpmiHost(name="test", data=self._valid_data)
     with pytest.raises(
             StateCheckError,
             message=
             "monitor should be not be able to be called before install"):
         instance.configure_ipxe_boot(boot_url)
    def test_configure_ipxe_boot(self, zboot):
        boot_url = "some.url"
        instance = ZerobootIpmiHost(name="test", data=self._valid_data)
        instance.state.set('actions', 'install', 'ok')

        # call with same ipxe URL as set in data
        instance.configure_ipxe_boot(self._valid_data["lkrnUrl"])
        instance._host.configure_ipxe_boot.assert_not_called()

        # call with difference ipxe URL as set in data
        instance.configure_ipxe_boot(boot_url)
        instance._host.configure_ipxe_boot.assert_called_with(boot_url)

        assert instance.data["lkrnUrl"] == boot_url