Beispiel #1
0
    def system_info(self):

        root = {}
        root['os_code'] = systeminfo.code()
        root['os_string'] = systeminfo.name()
        root['version'] = systeminfo.version()
        root['bit_type'] = systeminfo.bit_type()
        root['computer_name'] = systeminfo.computer_name()
        root['host_name'] = ''  # TODO(urgent): Implement

        logger.debug("System info sent: {0}".format(json.dumps(root)))

        return root
Beispiel #2
0
    def system_info(self):

        root = {}
        root['os_code'] = systeminfo.code()
        root['os_string'] = systeminfo.name()
        root['version'] = systeminfo.version()
        root['bit_type'] = systeminfo.bit_type()
        root['computer_name'] = systeminfo.computer_name()
        root['host_name'] = ''  # TODO(urgent): Implement

        logger.debug("System info sent: {0}".format(json.dumps(root)))

        return root
Beispiel #3
0
def test_os_name():
    """ Test the name of the OS.
    """

    os_code = systeminfo.code()
    os_string = 'Unknown'

    if os_code == 'darwin':
        mac_ver = platform.mac_ver()[0]
        os_string = "OS X %s" % mac_ver

    elif os_code == 'linux':
        distro_info = platform.linux_distribution(
            supported_dists=systeminfo.supported_linux_distros)

        os_string = '%s %s' % (distro_info[0], distro_info[1])

    eq_(systeminfo.name(), os_string, "OS name are not matching.")
Beispiel #4
0
def test_os_name():
    """ Test the name of the OS.
    """

    os_code = systeminfo.code()
    os_string = 'Unknown'

    if os_code == 'darwin':
        mac_ver = platform.mac_ver()[0]
        os_string = "OS X %s" % mac_ver

    elif os_code == 'linux':
        distro_info = platform.linux_distribution(
            supported_dists=systeminfo.supported_linux_distros)

        os_string = '%s %s' % (distro_info[0], distro_info[1])

    eq_(systeminfo.name(), os_string, "OS name are not matching.")