Ejemplo n.º 1
0
    def testVariousAccessors(self):
        try:
            if self.skip: raise SkipTest()
            biosVendorStr = HelperXml.getNodeText(self.dom, "TESTINPUT",
                                                  "smbios", "biosInformation",
                                                  "vendor")
            versionStr = HelperXml.getNodeText(self.dom, "TESTINPUT", "smbios",
                                               "biosInformation", "version")
            releaseStr = HelperXml.getNodeText(self.dom, "TESTINPUT", "smbios",
                                               "biosInformation", "release")

            biosStruct = self.tableObj.getStructureByType(0)  # BIOS Table type
            if len(biosVendorStr):
                self.assertEquals(biosVendorStr,
                                  biosStruct.getString(4))  # BIOS VENDOR
            if len(versionStr):
                self.assertEquals(versionStr,
                                  biosStruct.getString(5))  # BIOS VERSION
            if len(releaseStr):
                self.assertEquals(releaseStr,
                                  biosStruct.getString(8))  # RELEASE DATE

            import libsmbios_c.system_info as si
            self.assertEquals(si.get_bios_version(), biosStruct.getString(5))
        except SkipTest, e:
            print "skip ",
Ejemplo n.º 2
0
def isHdrFileNewer(file):
    try:
        ver = sysinfo.get_bios_version()
        hdrfile = rbu_hdr.HdrFile(file)
        return rbu_update.compareBiosVersions(hdrfile.biosVersion(), ver) > 0
    except rbu_hdr.InvalidRbuHdr, e:
        raise InvalidHdr(str(e))
Ejemplo n.º 3
0
def updateBios(hdrfile, options, testMode=False):
    meth = BaseRbu.getRbuMethod(hdrfile, options.update_mode)
    if options.check_sysid:
        id = sysinfo.get_dell_system_id()
        if id not in [i[0] for i in hdrfile.systemIds()]:
            raise InappropriateHDRFile( _("The .HDR file does not list this system (0x%04x) as a supported system. The supported systems are: %s") % (id, ["0x%04x" % x for x in hdrfile.systemIds()]) )

    if options.check_bios_version:
        ver = sysinfo.get_bios_version()
        if compareBiosVersions(ver, hdrfile.biosVersion()) >= 0:
            raise InappropriateHDRFile( _("The system bios version (%s) is the same as or newer than the .HDR file (%s).") % (ver, hdrfile.biosVersion()) )

    exit_code = 0
    if not testMode:
        exit_code = meth.doUpdate(options)

    return exit_code
Ejemplo n.º 4
0
    def testVariousAccessors(self):
        try:
            if self.skip: raise SkipTest()
            biosVendorStr = HelperXml.getNodeText( self.dom, "TESTINPUT", "smbios", "biosInformation", "vendor")
            versionStr = HelperXml.getNodeText( self.dom, "TESTINPUT", "smbios", "biosInformation", "version")
            releaseStr = HelperXml.getNodeText( self.dom, "TESTINPUT", "smbios", "biosInformation", "release")

            biosStruct = self.tableObj.getStructureByType(0) # BIOS Table type
            if len(biosVendorStr):
                self.assertEquals( biosVendorStr, biosStruct.getString(4) ) # BIOS VENDOR
            if len(versionStr):
                self.assertEquals( versionStr, biosStruct.getString(5) ) # BIOS VERSION
            if len(releaseStr):
                self.assertEquals( releaseStr, biosStruct.getString(8) ) # RELEASE DATE

            import libsmbios_c.system_info as si
            self.assertEquals( si.get_bios_version(), biosStruct.getString(5) )
        except SkipTest, e:
            print "skip ",
Ejemplo n.º 5
0
def getSystemBiosVer():
    return sysinfo.get_bios_version()