class FunctionalTest(GuestAgentTestCase):
    def setUp(self):
        self._config = ConfigParser()
        self._config.add_section("general")
        self._config.add_section("virtio")

        agent_class = None
        if platform.system() in ["Windows", "Microsoft"]:
            self._vport_name, agent_class = _win32_setup_test(self._config)
        else:
            self._vport_name, agent_class = _linux_setup_test(self._config)

        self._validator = MessageValidator(self._vport_name)
        self._vport = self._validator.port()
        test_port.add_test_port(self._vport_name, self._vport)

        self._config.set("general", "heart_beat_rate", "5")
        self._config.set("general", "report_user_rate", "10")
        self._config.set("general", "report_num_cpu_rate", "60")
        self._config.set("general", "report_application_rate", "120")
        self._config.set("general", "report_disk_usage", "300")
        self._config.set("virtio", "device", self._vport_name)

        self.vdsAgent = agent_class(self._config)

    def testRefresh(self):
        self._validator.verifyRefreshReply(self.vdsAgent)
        self._validator.verifyRefreshReply2(self.vdsAgent)

    def testSendInfo(self):
        self._validator.verifySendInfo(self.vdsAgent)

    def testSendAppList(self):
        self._validator.verifySendAppList(self.vdsAgent)

    def testSendDisksUsages(self):
        self._validator.verifySendDisksUsages(self.vdsAgent)

    def testSendMemoryStats(self):
        self._validator.verifySendMemoryStats(self.vdsAgent)

    def testSendFQDN(self):
        self._validator.verifySendFQDN(self.vdsAgent)

    def testSendUserInfo(self):
        self._validator.verifySendUserInfo(self.vdsAgent)

    def testSendNumberOfCPUs(self):
        self._validator.verifySendNumberOfCPUs(self.vdsAgent)

    def testSessionLogon(self):
        self._validator.verifySessionLogon(self.vdsAgent)

    def testSessionLogoff(self):
        self._validator.verifySessionLogon(self.vdsAgent)

    def testSessionLock(self):
        self._validator.verifySessionLock(self.vdsAgent)

    def testSessionUnlock(self):
        self._validator.verifySessionUnlock(self.vdsAgent)

    def testSessionStartup(self):
        self._validator.verifySessionStartup(self.vdsAgent)

    def testSessionShutdown(self):
        self._validator.verifySessionShutdown(self.vdsAgent)

    def testAPIVersion(self):
        self._validator.verifyAPIVersion(self.vdsAgent)

    def testAPIVersion2(self):
        self._validator.verifyAPIVersion2(self.vdsAgent)
Beispiel #2
0
class FunctionalTest(GuestAgentTestCase):
    def setUp(self):
        self._config = ConfigParser()
        self._config.add_section('general')
        self._config.add_section('virtio')

        agent_class = None
        if platform.system() in ['Windows', 'Microsoft']:
            self._vport_name, agent_class = _win32_setup_test(self._config)
        else:
            self._vport_name, agent_class = _linux_setup_test(self._config)

        self._validator = MessageValidator(self._vport_name)
        self._vport = self._validator.port()
        test_port.add_test_port(self._vport_name, self._vport)

        self._config.set('general', 'heart_beat_rate', '5')
        self._config.set('general', 'report_user_rate', '10')
        self._config.set('general', 'report_num_cpu_rate', '60')
        self._config.set('general', 'report_application_rate', '120')
        self._config.set('general', 'report_disk_usage', '300')
        self._config.set('virtio', 'device_prefix', self._vport_name)

        self.vdsAgent = agent_class(self._config)

    def testRefresh(self):
        self._validator.verifyRefreshReply(self.vdsAgent)

    def testRefresh2(self):
        self._validator.verifyRefreshReply2(self.vdsAgent)

    def testRefresh3(self):
        self._validator.verifyRefreshReply3(self.vdsAgent)

    def testRefresh4(self):
        self._validator.verifyRefreshReply4(self.vdsAgent)

    def testRefresh5(self):
        self._validator.verifyRefreshReply5(self.vdsAgent)

    def testRefresh6(self):
        self._validator.verifyRefreshReply6(self.vdsAgent)

    def testSendInfo(self):
        self._validator.verifySendInfo(self.vdsAgent)

    def testSendAppList(self):
        self._validator.verifySendAppList(self.vdsAgent)

    def testSendDisksUsages(self):
        self._validator.verifySendDisksUsages(self.vdsAgent)

    def testSendMemoryStats(self):
        self._validator.verifySendMemoryStats(self.vdsAgent)

    def testSendFQDN(self):
        self._validator.verifySendFQDN(self.vdsAgent)

    def testSendUserInfo(self):
        self._validator.verifySendUserInfo(self.vdsAgent)

    def testSendNumberOfCPUs(self):
        self._validator.verifySendNumberOfCPUs(self.vdsAgent)

    def testSessionLogon(self):
        self._validator.verifySessionLogon(self.vdsAgent)

    def testSessionLogoff(self):
        self._validator.verifySessionLogon(self.vdsAgent)

    def testSessionLock(self):
        self._validator.verifySessionLock(self.vdsAgent)

    def testSessionUnlock(self):
        self._validator.verifySessionUnlock(self.vdsAgent)

    def testSessionStartup(self):
        self._validator.verifySessionStartup(self.vdsAgent)

    def testSessionShutdown(self):
        self._validator.verifySessionShutdown(self.vdsAgent)

    def testAPIVersion(self):
        self._validator.verifyAPIVersion(self.vdsAgent)

    def testAPIVersion2(self):
        self._validator.verifyAPIVersion2(self.vdsAgent)