'Logging hook called by log_after_each_test to collect keyval
entries to be written in the test keyval.'

def log_test_keyvals(self, test_sysinfodir):

    keyval = {}
    keyval.update(self._read_sysinfo_keyvals(self.test_loggables, test_sysinfodir))
    keyval.update(self._read_sysinfo_keyvals(self.boot_loggables, os.path.join(test_sysinfodir, 'reboot_current')))
    if ('sysinfo-uname' in keyval):
        kernel_vers = '    '.join(keyval['sysinfo-uname'].split()[2:])
        keyval['sysinfo-uname'] = kernel_vers
    path = os.path.join(test_sysinfodir, 'reboot_current', 'meminfo')
    if os.path.exists(path):
        mem_data = open(path).read()
        match = re.search('^MemTotal:\\s+(\\d+)    kB$', mem_data, re.MULTILINE)
        if match:
            keyval['sysinfo-memtotal-in-kb'] = match.group(1)
    keyval['sysinfo-phys-mbytes'] = (utils_memory.rounded_memtotal() // 1024)
    return keyval
