Beispiel #1
0
    def testA_SoftwareManagement(self):
        """
        _SoftwareManagement_

        Test the SoftwareManagement code
        """

        self.assertEqual(SoftwareManagement.listSoftware(), {})
        softwareVersions = ReqMgrWebTools.allScramArchsAndVersions()
        ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
        result = SoftwareManagement.listSoftware()
        for scramArch in result.keys():
            self.assertEqual(set(result[scramArch]), set(softwareVersions[scramArch]))

        # Now for each scramArch insert a blank set
        # Because of the way that updateSoftware works, this interprets a blank list
        # as telling it that no softwareVersions are available.
        # It deletes every software version it is not handed, so it should give nothing out.
        for scramArch in result.keys():
            SoftwareManagement.updateSoftware(softwareNames = [], scramArch = scramArch)
        self.assertEqual(SoftwareManagement.listSoftware(), {})

        from WMCore.HTTPFrontEnd.RequestManager import Admin
        setattr(self.config, 'database', self.testInit.coreConfig.CoreDatabase)
        self.config.section_('templates')
        self.config.section_('html')
        admin = Admin.Admin(self.config)

        ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
        self.assertTrue('slc5_amd64_gcc434' in admin.scramArchs())
        return
Beispiel #2
0
    def testA_SoftwareManagement(self):
        """
        _SoftwareManagement_

        Test the SoftwareManagement code
        
        """
        self.assertEqual(SoftwareManagement.listSoftware(), {})
        softwareVersions = ReqMgrWebTools.allScramArchsAndVersions()
        ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
        result = SoftwareManagement.listSoftware()
        for scramArch in result.keys():
            self.assertEqual(set(result[scramArch]),
                             set(softwareVersions[scramArch]))

        # Now for each scramArch insert a blank set
        # Because of the way that updateSoftware works, this interprets a blank list
        # as telling it that no softwareVersions are available.
        # It deletes every software version it is not handed, so it should give nothing out.
        for scramArch in result.keys():
            SoftwareManagement.updateSoftware(softwareNames=[],
                                              scramArch=scramArch)
        self.assertEqual(SoftwareManagement.listSoftware(), {})

        # import has to be here, otherwise getting:
        # AttributeError: 'Toolbox' object has no attribute 'secmodv2' from the Admin module
        from WMCore.HTTPFrontEnd.RequestManager import Admin
        setattr(self.config, 'database', self.testInit.coreConfig.CoreDatabase)
        self.config.section_('templates')
        self.config.section_('html')
        admin = Admin.Admin(self.config)

        ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
        self.assertTrue('slc5_amd64_gcc434' in admin.scramArchs())
Beispiel #3
0
def updateScramArchsAndCMSSWVersions():
    """
    _updateScramArchsAndCMSSWVersions_

    Update both the scramArchs and their associated software versions to
    the current tag collector standard.
    """

    allArchsAndVersions = allScramArchsAndVersions()
    if allArchsAndVersions == {}:
        # The tag collector is probably down
        # NO valid CMSSW Versions is not a valid use case!
        # Do nothing.
        logging.error("Handed blank list of scramArchs/versions.  Ignoring for this cycle.")
        return
    for scramArch in allArchsAndVersions.keys():
        SoftwareAdmin.updateSoftware(scramArch=scramArch, softwareNames=allArchsAndVersions[scramArch])
Beispiel #4
0
def updateScramArchsAndCMSSWVersions():
    """
    _updateScramArchsAndCMSSWVersions_

    Update both the scramArchs and their associated software versions to
    the current tag collector standard.
    """

    allArchsAndVersions = allScramArchsAndVersions()
    if allArchsAndVersions == {}:
        # The tag collector is probably down
        # NO valid CMSSW Versions is not a valid use case!
        # Do nothing.
        logging.error("Handed blank list of scramArchs/versions.  Ignoring for this cycle.")
        return
    for scramArch in allArchsAndVersions.keys():
        SoftwareAdmin.updateSoftware(scramArch = scramArch,
                                     softwareNames = allArchsAndVersions[scramArch])
Beispiel #5
0
 def handleAddVersion(self, version):
     """ Registers a version """
     WMCore.Lexicon.cmsswversion(version)
     SoftwareAdmin.updateSoftware(version)
     return "Added version %s" % version