예제 #1
0
파일: ReqMgr_t.py 프로젝트: stuartw/WMCore
    def testH_RemoveSoftwareVersion(self):
        """
        _RemoveSoftwareVersion_

        Remove the software version after submitting the request.  See what that does.
        """
        myThread = threading.currentThread()

        userName = "******"
        groupName = "Li"
        teamName = "Tang"
        CMSSWVersion = "CMSSW_3_5_8"
        scramArch = "slc5_ia32_gcc434"
        schema = self.setupSchema(
            userName=userName, groupName=groupName, teamName=teamName, CMSSWVersion=CMSSWVersion, scramArch=scramArch
        )

        result = self.jsonSender.put("request/testRequest", schema)
        self.assertEqual(result[1], 200)
        requestName = result[0]["RequestName"]

        req = self.jsonSender.get("request/%s" % requestName)[0]
        self.assertEqual(req["SoftwareVersions"], [CMSSWVersion])

        # Delete software versions and make sure they're gone from the DB
        SoftwareManagement.removeSoftware(softwareName=CMSSWVersion, scramArch=scramArch)
        versions = myThread.dbi.processData("SELECT * FROM reqmgr_software")[0].fetchall()
        self.assertEqual(versions, [])
        assocs = myThread.dbi.processData("SELECT * FROM reqmgr_software_dependency")[0].fetchall()
        self.assertEqual(assocs, [])

        req = self.jsonSender.get("request/%s" % requestName)[0]
        self.assertEqual(req["SoftwareVersions"], [CMSSWVersion])
        return
예제 #2
0
    def testH_RemoveSoftwareVersion(self):
        """
        _RemoveSoftwareVersion_

        Remove the software version after submitting the request.  See what that does.
        
        """
        myThread = threading.currentThread()
        userName     = '******'
        groupName    = 'Li'
        teamName     = 'Tang'
        schema       = utils.getAndSetupSchema(self,
                                               userName = userName,
                                               groupName = groupName,
                                               teamName = teamName)
        result = self.jsonSender.put('request/testRequest', schema)
        self.assertEqual(result[1], 200)
        requestName = result[0]['RequestName']

        req = self.jsonSender.get('request/%s' % requestName)[0]
        self.assertEqual(req['SoftwareVersions'], [schema["CMSSWVersion"]])

        # Delete software versions and make sure they're gone from the DB
        SoftwareManagement.removeSoftware(softwareName = schema["CMSSWVersion"],
                                          scramArch = schema["ScramArch"])
        versions = myThread.dbi.processData("SELECT * FROM reqmgr_software")[0].fetchall()
        self.assertEqual(versions, [])
        assocs = myThread.dbi.processData("SELECT * FROM reqmgr_software_dependency")[0].fetchall()
        self.assertEqual(assocs, [])
        
        req = self.jsonSender.get('request/%s' % requestName)[0]
        self.assertEqual(req['SoftwareVersions'], [schema["CMSSWVersion"]])
예제 #3
0
    def testH_RemoveSoftwareVersion(self):
        """
        _RemoveSoftwareVersion_

        Remove the software version after submitting the request.  See what that does.
        
        """
        myThread = threading.currentThread()
        userName = '******'
        groupName = 'Li'
        teamName = 'Tang'
        schema = utils.getAndSetupSchema(self,
                                         userName=userName,
                                         groupName=groupName,
                                         teamName=teamName)
        result = self.jsonSender.put('request/testRequest', schema)
        self.assertEqual(result[1], 200)
        requestName = result[0]['RequestName']

        req = self.jsonSender.get('request/%s' % requestName)[0]
        self.assertEqual(req['SoftwareVersions'], [schema["CMSSWVersion"]])

        # Delete software versions and make sure they're gone from the DB
        SoftwareManagement.removeSoftware(softwareName=schema["CMSSWVersion"],
                                          scramArch=schema["ScramArch"])
        versions = myThread.dbi.processData(
            "SELECT * FROM reqmgr_software")[0].fetchall()
        self.assertEqual(versions, [])
        assocs = myThread.dbi.processData(
            "SELECT * FROM reqmgr_software_dependency")[0].fetchall()
        self.assertEqual(assocs, [])

        req = self.jsonSender.get('request/%s' % requestName)[0]
        self.assertEqual(req['SoftwareVersions'], [schema["CMSSWVersion"]])
예제 #4
0
 def deleteVersion(self, version, scramArch):
     """ Un-register this software version with ReqMgr """
     SoftwareAdmin.removeSoftware(version, scramArch)
예제 #5
0
 def deleteVersion(self, version, scramArch):
     """ Un-register this software version with ReqMgr """
     SoftwareAdmin.removeSoftware(version, scramArch)