def test_apply_mof(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config)
def test_apply_mof(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') dsc.apply_dsc_configuration('mof/localhost.nxFile.mof') self.assertTrue(os.path.exists('/tmp/dsctest'))
def test_nodeid_with_dsc(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') nodeid = dsc.get_nodeid('/etc/opt/omi/conf/omsconfig/agentid') self.assertTrue(nodeid is not None, "nodeid is none")
def test_nodeid_with_dsc(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') nodeid = dsc.get_nodeid('/etc/opt/omi/conf/omsconfig/agentid') self.assertTrue(nodeid is not None, "nodeid is none")
def test_apply_mof(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = Dummy() dsc.hutil.log = waagent.Log dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config)
def test_apply_mof(self): dsc.distro_info = platform.dist() dsc.hutil = Dummy() dsc.hutil.log = waagent.Log dsc.install_dsc_packages() dsc.start_omiserver() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config)
def test_apply_mof(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration( 'mof/dscnode.nxFile.meta.push.mof') dsc.apply_dsc_configuration('mof/localhost.nxFile.mof') self.assertTrue(os.path.exists('/tmp/dsctest'))
def test_is_statusfile_update_pull(self): status_file = 'status/0.status' dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config) self.verify_nodeid_vmuuid(status_file)
def test_is_statusfile_update_pull(self): status_file = 'status/0.status' dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config) self.verify_nodeid_vmuuid(status_file)
def test_is_statusfile_update_push(self): status_file = 'status/0.status' dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') dsc.apply_dsc_configuration('mof/localhost.nxFile.mof') self.assertTrue(os.path.exists('/tmp/dsctest')) self.verify_nodeid_vmuuid(status_file)
def test_is_statusfile_update_push(self): status_file = 'status/0.status' dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') dsc.apply_dsc_configuration('mof/localhost.nxFile.mof') self.assertTrue(os.path.exists('/tmp/dsctest')) self.verify_nodeid_vmuuid(status_file)
def test_push_request_properties(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.push.mof') self.assertTrue('ReturnValue=0' in config) response = dsc.send_heart_beat_msg_to_agent_service("install") self.assertIsNone(response)
def test_send_request_to_pullserver(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/azureautomation.df.meta.mof') self.assertTrue('ReturnValue=0' in config) response = dsc.send_heart_beat_msg_to_agent_service("install") self.assertEqual(response.status_code, 200)
def test_send_request_to_pullserver(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration( 'mof/azureautomation.df.meta.mof') self.assertTrue('ReturnValue=0' in config) response = dsc.send_heart_beat_msg_to_agent_service() self.assertEqual(response.status_code, 200)
def test_properties_for_pull(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration('mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config) content = dsc.construct_node_extension_properties(config, "upgrade") data = json.dumps(content) self.assertTrue('OMSCloudId' in data, "OMSCLoudID doesn't exist")
def test_push_request_properties(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration( 'mof/dscnode.nxFile.meta.push.mof') self.assertTrue('ReturnValue=0' in config) response = dsc.send_heart_beat_msg_to_agent_service() self.assertIsNone(response)
def test_properties_for_pull(self): dsc.distro_category = dsc.get_distro_category() dsc.hutil = MockUtil(self) dsc.install_dsc_packages() dsc.start_omiservice() config = dsc.apply_dsc_meta_configuration( 'mof/dscnode.nxFile.meta.mof') self.assertTrue('ReturnValue=0' in config) content = dsc.construct_node_extension_properties(config) data = json.dumps(content) self.assertTrue('OMSCloudId' in data, "OMSCLoudID doesn't exist")