Example #1
0
    def test_wrong_server(self):
        options = Options("wrong_server", "abc", "def")
        s = Satellite(self.logger, options)
        #self.assertRaises(SatelliteError, s.connect, "wrong_server", "abc", "def")
        options.env = "ENV"
        options.owner = "OWNER"

        s.hypervisorCheckIn(options, {}, "test")
Example #2
0
    def test_new_system(self):
        options = Options("http://localhost:%s" % TEST_PORT, "username", "password")
        options.force_register = True
        s = Satellite(self.logger, options)

        config = Config("test", "libvirt")
        report = HostGuestAssociationReport(config, self.mapping)
        s.hypervisorCheckIn(report, options)
Example #3
0
    def test_wrong_server(self):
        options = Options("wrong_server", "abc", "def")
        s = Satellite(self.logger, options)
        #self.assertRaises(SatelliteError, s.connect, "wrong_server", "abc", "def")
        options.env = "ENV"
        options.owner = "OWNER"

        s.hypervisorCheckIn(options, {'hypervisors': []}, "test")
Example #4
0
    def test_hypervisorCheckIn(self):
        options = Options("http://localhost:%s" % TEST_PORT, "username", "password")
        options.force_register = True
        s = Satellite(self.logger, options)

        config = Config("test", "libvirt")
        report = HostGuestAssociationReport(config, self.mapping)
        result = s.hypervisorCheckIn(report, options)
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #5
0
    def test_hypervisorCheckIn(self):
        options = Options("http://localhost:%s" % TEST_PORT, "username", "password")
        options.force_register = True
        options.env = "ENV"
        options.owner = "OWNER"
        s = Satellite(self.logger, options)

        result = s.hypervisorCheckIn(options, self.mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #6
0
    def test_hypervisorCheckIn(self):
        options = Options("http://localhost:%s" % TEST_PORT, "username",
                          "password")
        options.force_register = True
        options.env = "ENV"
        options.owner = "OWNER"
        s = Satellite(self.logger, options)

        result = s.hypervisorCheckIn(options, self.mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #7
0
    def test_hypervisorCheckIn(self):
        options = Options("http://localhost:8080", "username", "password")
        options.force_register = True
        s = Satellite(self.logger, options)

        mapping = {
            'host-1': ['guest1-1', 'guest1-2'],
            'host-2': ['guest2-1', 'guest2-2', 'guest2-3']
        }
        result = s.hypervisorCheckIn("owner", "env", mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #8
0
    def test_hypervisorCheckIn(self):
        options = Options("http://localhost:8080", "username", "password")
        options.force_register = True
        s = Satellite(self.logger, options)

        mapping = {
            'host-1': ['guest1-1', 'guest1-2'],
            'host-2': ['guest2-1', 'guest2-2', 'guest2-3']
        }
        result = s.hypervisorCheckIn("owner", "env", mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #9
0
    def test_hypervisorCheckIn_preregistered(self):
        temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID)
        self.addCleanup(os.unlink, filename)
        f = os.fdopen(temp, "wb")
        pickle.dump({"system_id": TEST_SYSTEM_ID}, f)
        f.close()

        options = Options("http://localhost:%s" % TEST_PORT, "username", "password")
        s = Satellite(self.logger, options)

        s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, "%s")

        config = Config("test", "libvirt")
        report = HostGuestAssociationReport(config, self.mapping)
        result = s.hypervisorCheckIn(report, options)
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #10
0
    def test_hypervisorCheckIn_preregistered(self):
        temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID)
        self.addCleanup(os.unlink, filename)
        f = os.fdopen(temp, "wb")
        pickle.dump({'system_id': TEST_SYSTEM_ID}, f)
        f.close()

        options = Options("http://localhost:%s" % TEST_PORT, "username", "password")
        options.env = "ENV"
        options.owner = "OWNER"
        s = Satellite(self.logger, options)

        s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s')

        result = s.hypervisorCheckIn(options, self.mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #11
0
    def test_hypervisorCheckIn_preregistered(self):
        temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID)
        self.addCleanup(os.unlink, filename)
        f = os.fdopen(temp, "wb")
        pickle.dump({'system_id': TEST_SYSTEM_ID}, f)
        f.close()

        options = Options("http://localhost:8080", "username", "password")
        s = Satellite(self.logger, options)

        s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s')
        mapping = {
            'host-1': ['guest1-1', 'guest1-2'],
            'host-2': ['guest2-1', 'guest2-2', 'guest2-3']
        }
        result = s.hypervisorCheckIn("owner", "env", mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #12
0
    def test_hypervisorCheckIn_preregistered(self):
        temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID)
        self.addCleanup(os.unlink, filename)
        f = os.fdopen(temp, "wb")
        pickle.dump({'system_id': TEST_SYSTEM_ID}, f)
        f.close()

        options = Options("http://localhost:8080", "username", "password")
        s = Satellite(self.logger, options)

        s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s')
        mapping = {
            'host-1': ['guest1-1', 'guest1-2'],
            'host-2': ['guest2-1', 'guest2-2', 'guest2-3']
        }
        result = s.hypervisorCheckIn("owner", "env", mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #13
0
    def test_hypervisorCheckIn_preregistered(self):
        temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID)
        self.addCleanup(os.unlink, filename)
        f = os.fdopen(temp, "wb")
        pickle.dump({'system_id': TEST_SYSTEM_ID}, f)
        f.close()

        options = Options("http://localhost:%s" % TEST_PORT, "username",
                          "password")
        options.env = "ENV"
        options.owner = "OWNER"
        s = Satellite(self.logger, options)

        s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s')

        result = s.hypervisorCheckIn(options, self.mapping, "type")
        self.assertTrue("failedUpdate" in result)
        self.assertTrue("created" in result)
        self.assertTrue("updated" in result)
Example #14
0
 def test_new_system(self):
     options = Options("http://localhost:8080", "username", "password")
     options.force_register = True
     s = Satellite(self.logger, options)
Example #15
0
 def test_wrong_server(self):
     options = Options("wrong_server", "abc", "def")
     s = Satellite(self.logger, options)
     #self.assertRaises(SatelliteError, s.connect, "wrong_server", "abc", "def")
     s.hypervisorCheckIn("owner", "env", {}, "test")
Example #16
0
 def test_wrong_server(self):
     options = Options("wrong_server", "abc", "def")
     s = Satellite(self.logger, options)
     #self.assertRaises(SatelliteError, s.connect, "wrong_server", "abc", "def")
     s.hypervisorCheckIn("owner", "env", {}, "test")