コード例 #1
0
 def test_check_boot_time(self):
     """
     check if there's boot time delay
     """
     max_boot_time = 60
     boot_time_sec = utils_lib.getboottime(self)
     utils_lib.compare_nums(self, num1=boot_time_sec, num2=max_boot_time, ratio=0, msg="Compare with cfg specified max_boot_time")
コード例 #2
0
 def test_check_boot_time(self):
     '''
     polarion_id: RHEL7-93100
     bz: 1776710
     check the boot time.
     '''
     max_boot_time = self.params.get('max_boot_time')
     boot_time_sec = utils_lib.getboottime(self)
     utils_lib.compare_nums(self,
                            num1=boot_time_sec,
                            num2=max_boot_time,
                            ratio=0,
                            msg="Compare with cfg specified max_boot_time")
コード例 #3
0
    def test_check_lshw_mem(self):
        '''
        case_name:
            test_check_lshw_mem

        case_priority:
            1

        component:
            lshw

        bugzilla_id:
            1882157

        polarion_id:
            n/a

        maintainer:
            [email protected]

        description:
            Check "lshw -C memory -json" reported memory size is correct.

        key_steps:
            1. # lshw -C memory -json

        expected_result:
            No big gap found.
            eg. #  lshw -C memory -json|grep -i size
                    "size" : 98304,
                    "size" : 4286578688, <-- 4GiB is correct
                        "size" : 4286578688,

        '''
        utils_lib.is_cmd_exist(self, cmd='lshw')
        base_memory = utils_lib.get_memsize(self)
        cmd = 'lshw -json'
        output = utils_lib.run_cmd(self, cmd, expect_ret=0)
        out = json.loads(output)['children'][0]["children"]
        for i in out:
            if i['id'] == 'memory':
                mem_in_byte = i['size']
                break
        mem_in_gib = mem_in_byte / 1024 / 1024 / 1024
        self.log.info("lshw showed mem: {}".format(mem_in_gib))

        utils_lib.compare_nums(self, mem_in_gib, base_memory, ratio=15)
コード例 #4
0
 def test_check_reboot_time(self):
     """
     case_tag:
         GeneralVerification
     case_name:
         test_check_reboot_time
     case_file:
         os_tests.tests.test_nutanix_vm.test_check_reboot_time
     component:
         GeneralVerification
     bugzilla_id:
         N/A
     is_customer_case:
         False
     customer_case_id:
         N/A
     testplan:
         N/A
     maintainer:
         [email protected]
     description:
         Verify VM reboot time
     key_steps: |
         1. Reboot VM gracefully
         1. Get system boot time via "systemd-analyze"
         2. Compare with acpi_reboot in nutanix.yaml
     expect_result:
         Boot time less than acpi_reboot in nutanix.yaml
     debug_want:
         systemd-analyze
     debug_want:
         N/A
     """
     self.vm.reboot(wait=True)
     utils_lib.init_connection(self)
     reboot_time = self.vm.params['BootTime']['acpi_reboot']
     boot_time_sec = utils_lib.getboottime(self)
     utils_lib.compare_nums(self,
                            num1=boot_time_sec,
                            num2=reboot_time,
                            ratio=0,
                            msg="Compare with cfg specified reboot_time")
コード例 #5
0
 def test_check_firstlaunch_time(self):
     """
     case_tag:
         GeneralVerification
     case_name:
         test_check_firstlaunch_time
     case_file:
         os_tests.tests.test_nutanix_vm.test_check_firstlaunch_time
     component:
         GeneralVerification
     bugzilla_id:
         N/A
     is_customer_case:
         False
     customer_case_id:
         N/A
     testplan:
         N/A
     maintainer:
         [email protected]
     description:
         Verify VM first launch time
     key_steps: |
         1. Get system boot time via "systemd-analyze"
         2. Compare with first_launch in nutanix.yaml
     expect_result:
         Boot time less than first_launch in nutanix.yaml
     debug_want:
         systemd-analyze
     debug_want:
         N/A
     """
     firstlaunch_time = self.vm.params['BootTime']['first_launch']
     boot_time_sec = utils_lib.getboottime(self)
     utils_lib.compare_nums(
         self,
         num1=boot_time_sec,
         num2=firstlaunch_time,
         ratio=0,
         msg="Compare with cfg specified firstlaunch_time")