コード例 #1
0
 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)
コード例 #2
0
 def test_register(self):
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('somekey','http://dummy','','','','')
     self.assertEqual(exit_code, 0)
コード例 #3
0
 def test_register_without_registration_info(self):
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('','','','','','')
     self.assertEqual(exit_code, 51)
コード例 #4
0
 def test_is_statusfile_update_register(self):
     status_file = 'status/0.status'
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('somekey','http://dummy','','','','')
     self.verify_nodeid_vmuuid(status_file)
コード例 #5
0
 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")
コード例 #6
0
 def test_register(self):
     print "Register test case with valid parameters"
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('somekey','http://dummy','test.localhost.mof','15','30','applyandmonitor')
     self.assertEqual(exit_code, 0)
コード例 #7
0
 def test_register_without_registration_info(self):
     print "Register test case with invalid Registration url and Registration key"
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('','','','','','')
     self.assertEqual(exit_code, 51)
コード例 #8
0
 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()
     dsc.apply_dsc_configuration('mof/localhost.nxFile.mof')
     self.assertTrue(os.path.exists('/tmp/dsctest'))
コード例 #9
0
 def test_register_invalid_configuration_mode(self):
     print "Register test case with invalid configuration mode"
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('somekey','http://dummy','','','','some')	
     self.assertEqual(exit_code, 51)
コード例 #10
0
 def test_is_statusfile_update_register(self):
     status_file = 'status/0.status'
     dsc.distro_category = dsc.get_distro_category()
     dsc.hutil = MockUtil(self)
     dsc.install_dsc_packages()
     dsc.start_omiservice()
     exit_code, output = dsc.register_automation('somekey','http://dummy','','','','')
     self.verify_nodeid_vmuuid(status_file)
コード例 #11
0
 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")
コード例 #12
0
 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'))
コード例 #13
0
 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)
コード例 #14
0
 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)
コード例 #15
0
 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)
コード例 #16
0
 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'))
コード例 #17
0
 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)
コード例 #18
0
 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)
コード例 #19
0
 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)
コード例 #20
0
 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)
コード例 #21
0
    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)
コード例 #22
0
 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")
コード例 #23
0
    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)
コード例 #24
0
    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")