def test_01_ping_in_vr_success(self):
        '''
        Test Ping command execution in VR
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on VR

        list_router_response = list_routers(
            self.apiclient,
            account=self.account.name,
            domainid=self.account.domainid
        )
        self.assertEqual(
            isinstance(list_router_response, list),
            True,
            "Check list response returns a valid list"
        )
        router = list_router_response[0]
        self.debug('Starting the router with ID: %s' % router.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = router.id
        cmd.ipaddress = '8.8.8.8'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Ping in VR')
    def test_09_arping_in_cpvm(self):
        '''
        Test Arping command execution in CPVM
        '''

        # Validate the following:
        # 1. Arping command is executed remotely on CPVM

        list_cpvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='secondarystoragevm',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_cpvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        cpvm = list_cpvm_response[0]

        self.debug('Setting up CPVM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = cpvm.gateway
        cmd.type = 'arping'
        cmd.params = '-I eth2'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Arping in CPVM'
        )
    def test_12_traceroute_in_cpvm(self):
        '''
        Test Traceroute command execution in CPVMM
        '''

        # Validate the following:
        # 1. Traceroute command is executed remotely on CPVM

        list_cpvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='consoleproxy',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_cpvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        cpvm = list_cpvm_response[0]

        self.debug('Setting up CPVMM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = '8.8.4.4'
        cmd.type = 'traceroute'
        cmd.params = '-m 5'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Traceroute in CPVM'
        )
    def test_02_ping_in_vr_failure(self):
        '''
        Test Ping command execution in VR
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on VR
        # 2. Validate Ping command execution with a non-existent/pingable IP address

        if self.hypervisor.lower() == 'simulator':
            raise self.skipTest("Skipping negative test case for Simulator hypervisor")

        list_router_response = list_routers(
            self.apiclient,
            account=self.account.name,
            domainid=self.account.domainid
        )
        self.assertEqual(
            isinstance(list_router_response, list),
            True,
            "Check list response returns a valid list"
        )
        router = list_router_response[0]
        self.debug('Starting the router with ID: %s' % router.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = router.id
        cmd.ipaddress = '192.0.2.2'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertNotEqual(
            '0',
            cmd_response.exitcode,
            'Check diagnostics command returns a non-zero exit code')
    def test_03_ping_in_ssvm_success(self):
        '''
        Test Ping command execution in SSVM
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on SSVM

        list_ssvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='secondarystoragevm',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_ssvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        ssvm = list_ssvm_response[0]

        self.debug('Setting up SSVM with ID %s' % ssvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = ssvm.id
        cmd.ipaddress = '8.8.8.8'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Ping in SSVM'
        )
Example #6
0
    def test_12_traceroute_in_cpvm(self):
        '''
        Test Traceroute command execution in CPVMM
        '''

        # Validate the following:
        # 1. Traceroute command is executed remotely on CPVM

        list_cpvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='consoleproxy',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_cpvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        cpvm = list_cpvm_response[0]

        self.debug('Setting up CPVMM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = '8.8.4.4'
        cmd.type = 'traceroute'
        cmd.params = '-m 10'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Traceroute in CPVM'
        )
Example #7
0
    def test_06_ping_in_cpvm_failure(self):
        '''
        Test Ping command execution in CPVM
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on CPVM
        # 2. Validate Ping command execution with a non-existent/pingable IP address

        if self.hypervisor.lower() == 'simulator':
            raise self.skipTest(
                "Skipping negative test case for Simulator hypervisor")

        list_ssvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='consoleproxy',
            state='Running',
        )

        self.assertEqual(isinstance(list_ssvm_response, list), True,
                         'Check list response returns a valid list')
        cpvm = list_ssvm_response[0]

        self.debug('Setting up CPVM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = '192.0.2.2'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertNotEqual(
            '0', cmd_response.exitcode,
            'Check diagnostics command returns a non-zero exit code')
Example #8
0
    def test_10_traceroute_in_vr(self):
        '''
        Test Arping command execution in VR
        '''

        # Validate the following:
        # 1. Arping command is executed remotely on VR

        list_router_response = list_routers(
            self.apiclient,
            account=self.account.name,
            domainid=self.account.domainid
        )
        self.assertEqual(
            isinstance(list_router_response, list),
            True,
            "Check list response returns a valid list"
        )
        router = list_router_response[0]
        self.debug('Starting the router with ID: %s' % router.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = router.id
        cmd.ipaddress = '8.8.4.4'
        cmd.type = 'traceroute'
        cmd.params = "-m 10"
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Arping in VR')
Example #9
0
    def test_09_arping_in_cpvm(self):
        '''
        Test Arping command execution in CPVM
        '''

        # Validate the following:
        # 1. Arping command is executed remotely on CPVM

        list_cpvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='secondarystoragevm',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_cpvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        cpvm = list_cpvm_response[0]

        self.debug('Setting up CPVM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = cpvm.gateway
        cmd.type = 'arping'
        cmd.params = '-I eth2'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Arping in CPVM'
        )
Example #10
0
    def test_03_ping_in_ssvm_success(self):
        '''
        Test Ping command execution in SSVM
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on SSVM

        list_ssvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='secondarystoragevm',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_ssvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        ssvm = list_ssvm_response[0]

        self.debug('Setting up SSVM with ID %s' % ssvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = ssvm.id
        cmd.ipaddress = '8.8.8.8'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertEqual(
            '0',
            cmd_response.exitcode,
            'Failed to run remote Ping in SSVM'
        )
Example #11
0
    def test_02_ping_in_vr_failure(self):
        '''
        Test Ping command execution in VR
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on VR
        # 2. Validate Ping command execution with a non-existent/pingable IP address

        if self.hypervisor.lower() == 'simulator':
            raise self.skipTest("Skipping negative test case for Simulator hypervisor")

        list_router_response = list_routers(
            self.apiclient,
            account=self.account.name,
            domainid=self.account.domainid
        )
        self.assertEqual(
            isinstance(list_router_response, list),
            True,
            "Check list response returns a valid list"
        )
        router = list_router_response[0]
        self.debug('Starting the router with ID: %s' % router.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = router.id
        cmd.ipaddress = '192.0.2.2'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertNotEqual(
            '0',
            cmd_response.exitcode,
            'Check diagnostics command returns a non-zero exit code')
Example #12
0
    def test_06_ping_in_cpvm_failure(self):
        '''
        Test Ping command execution in CPVM
        '''

        # Validate the following:
        # 1. Ping command is executed remotely on CPVM
        # 2. Validate Ping command execution with a non-existent/pingable IP address

        if self.hypervisor.lower() == 'simulator':
            raise self.skipTest("Skipping negative test case for Simulator hypervisor")

        list_ssvm_response = list_ssvms(
            self.apiclient,
            systemvmtype='consoleproxy',
            state='Running',
        )

        self.assertEqual(
            isinstance(list_ssvm_response, list),
            True,
            'Check list response returns a valid list'
        )
        cpvm = list_ssvm_response[0]

        self.debug('Setting up CPVM with ID %s' % cpvm.id)

        cmd = runDiagnostics.runDiagnosticsCmd()
        cmd.targetid = cpvm.id
        cmd.ipaddress = '192.0.2.2'
        cmd.type = 'ping'
        cmd_response = self.apiclient.runDiagnostics(cmd)

        self.assertNotEqual(
            '0',
            cmd_response.exitcode,
            'Check diagnostics command returns a non-zero exit code'
        )