Esempio n. 1
0
 def run(self, arglist):
     trigger = AgentTrigger(self.agent)
     server = self.adapter.setUpServer(self.getGuest("server"), "16000")
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.disable()
     assertions.assertTrue(
         autoupdate.checkKeyPresent() and not autoupdate.isActive(),
         "Xapi does not indicate that AutoUpdate is disabled")
     autoupdate.setUserVMUser()
     assertions.assertFalse(autoupdate.checkKeyPresent(),
                            "DisableAutoUpdate reg key is present")
     self._shouldNotBePinged(trigger, server)
     autoupdate.enable()
     assertions.assertTrue(autoupdate.checkKeyPresent(),
                           "DisableAutoUpdate reg key is not present")
     self._shouldNotBePinged(trigger, server)
     autoupdate.setUserPoolAdmin()
     autoupdate.enable()
     assertions.assertTrue(
         autoupdate.checkKeyPresent() and autoupdate.isActive(),
         "Xapi does not indicate that AutoUpdate is enabled")
     autoupdate.setUserVMUser()
     autoupdate.disable()
     assertions.assertTrue(
         autoupdate.checkKeyPresent() and not autoupdate.isActive(),
         "registry does not indicate that AutoUpdate is disabled")
     self._shouldNotBePinged(trigger, server)
Esempio n. 2
0
    def checkFeature(self, currentSKU):
        # Restrict read caching = True / False
        feature = ReadCaching()
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        featureRestricted = self.licenseFeatureFactory.getFeatureState(
            self.systemObj.master.productVersion, currentSKU, feature)

        assertions.assertEquals(
            featureRestricted, featureResctictedFlag,
            "Feature flag on host does not match actual permissions. Feature allowed: %s, Feature restricted: %s"
            % (featureRestricted, featureResctictedFlag))

        # Check read caching values before any VMs.
        enabledList = feature.isEnabled(self.systemObj.master)
        assertions.assertFalse(
            True in enabledList,
            "Read Caching is enabled before any VMs created.")

        # Create VM..
        guest = self.systemObj.master.createGenericLinuxGuest(sr="nfsstorage")
        guest.snapshot()
        guest.reboot()

        # Check we have the right read caching priviledge.
        enabledList = feature.isEnabled(self.systemObj.master)
        assertions.assertEquals(
            not featureRestricted, True in enabledList,
            "Read caching restriction is not as expected after creating new VM. Should be: %s"
            % (featureRestricted))

        # Remove License.
        self.licenseManager.releaseLicense(self.systemObj)

        # Check, should still the same RC privilidge.
        enabledList = feature.isEnabled(self.systemObj.master)
        assertions.assertEquals(
            not featureRestricted, True in enabledList,
            "Read caching restriction is not as expected after removing license, but not performing lifecycle / tootstack restart. Should be: %s"
            % (featureRestricted))

        guest.reboot()

        # Check flag again
        # Should be restricted after removing license.
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        assertions.assertTrue(
            featureResctictedFlag,
            "Feature flag is not restricted after removing license. Feature restricted: %s"
            % (featureResctictedFlag))

        # Check that read caching is now disabled.
        enabledList = feature.isEnabled(self.systemObj.master)
        assertions.assertFalse(
            True in enabledList,
            "Read Caching is enabled after removing license and lifecycle operation."
        )

        guest.uninstall()
Esempio n. 3
0
    def checkFeature(self, currentSKU):
        # Check flag and feature on licensed host.
        feature = VirtualGPU()
        featureRestricted = self.licenseFeatureFactory.getFeatureState(
            self.systemObj.master.productVersion, currentSKU, feature)
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        assertions.assertEquals(
            featureRestricted, featureResctictedFlag,
            "Feature flag on host does not match actual permissions. Feature allowed: %s, Feature restricted: %s"
            % (featureRestricted, featureResctictedFlag))

        enabled = feature.isEnabled(self.systemObj.master)
        self.confirmLicenseServerUp()
        assertions.assertEquals(
            not featureRestricted, enabled,
            "vGPU privilidge is not as expected after creating new VM. Should be: %s"
            % (featureRestricted))

        # Unlicense host.
        self.licenseManager.releaseLicense(self.systemObj)

        # Check flag and functionality again, after removing license.
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        assertions.assertTrue(
            featureResctictedFlag,
            "Feature flag is not restricted after removing license. Feature restricted: %s"
            % (featureResctictedFlag))

        enabled = feature.isEnabled(self.systemObj.master)
        self.confirmLicenseServerUp()
        assertions.assertFalse(
            enabled,
            "vGPU is enabled after removing license and lifecycle operation.")
Esempio n. 4
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     assertions.assertTrue(vss.isSnapshotPossible(),
                           "snapshot failed in licensed pool")
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(vss.isSnapshotPossible(),
                            "snapshot succeeded in unlicensed pool")
Esempio n. 5
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     autoUpdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertTrue(vss.isLicensed(),"Xenstore indicates VSS is Not Licensed")
     assertions.assertTrue(autoUpdate.isLicensed(),"Xenstore indicates AutoUpdate is Not Licensed")
     self.adapter.releaseLicense(self.getHost("RESOURCE_HOST_1"))
     assertions.assertFalse(vss.isLicensed(),"Xenstore indicates VSS is Licensed")
     assertions.assertFalse(autoUpdate.isLicensed(),"Xenstore indicates AutoUpdate is Licensed")
Esempio n. 6
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     assertions.assertFalse(
         vss.isSnapshotPossible(),
         "VSS Snapshot Taken on Non Serverclass Windows")
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(
         vss.isSnapshotPossible(),
         "VSS Snapshot Taken on Non Serverclass Windows")
Esempio n. 7
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     autoUpdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertTrue(vss.isLicensed(),
                           "Xenstore indicates VSS is Not Licensed")
     assertions.assertTrue(autoUpdate.isLicensed(),
                           "Xenstore indicates AutoUpdate is Not Licensed")
     self.adapter.releaseLicense(self.getHost("RESOURCE_HOST_1"))
     assertions.assertFalse(vss.isLicensed(),
                            "Xenstore indicates VSS is Licensed")
     assertions.assertFalse(autoUpdate.isLicensed(),
                            "Xenstore indicates AutoUpdate is Licensed")
Esempio n. 8
0
 def run(self, arglist):
     server = self.adapter.setUpServer(self.getGuest("server"),"16000")
     server.createCatalog("99.0.0.0")
     msiHandler = NonCryptoMSIHandler()
     msiHandler.getMSIs(server)
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.enable()
     autoupdate.setURL("http://%s:16000"%server.getIP())
     self.agent.restartAgent()
     xenrt.sleep(200)
     assertions.assertNotNone(autoupdate.checkDownloadedMSI(),"msi has not downloaded")
     assertions.assertFalse(msiHandler.installed(self.win1),"Non cryprographically signed msi installed")
Esempio n. 9
0
 def run(self,arglist):
     trigger = AgentTrigger(self.agent)
     server = self.adapter.setUpServer(self.getGuest("server"),"16000")
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.setUserVMUser()
     autoupdate.disable()
     autoupdate.setURL("http://%s:16000"% server.getIP())
     self._shouldNotBePinged(trigger,server)
     autoupdate.enable()
     self._shouldBePinged(trigger,server)
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(autoupdate.isLicensed(),"autoupdate is licensed when it shouldn't be")
     self._shouldNotBePinged(trigger,server)
Esempio n. 10
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     path = self.adapter.exportVM(self.win1)
     self.adapter.releaseLicense(self.getDefaultPool())
     self.adapter.importVM(self.win1,self.getHost("RESOURCE_HOST_1"),path)
     vss = self.agent.getLicensedFeature("VSS")
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertFalse(vss.isLicensed() or autoupdate.isLicensed(),"Agent features are licensed when they shouldn't be")
     path = self.adapter.exportVM(self.win1)
     self.adapter.applyLicense(self.getDefaultPool())
     self.adapter.importVM(self.win1,self.getHost("RESOURCE_HOST_0"),path)
     vss = self.agent.getLicensedFeature("VSS")
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertTrue(vss.isLicensed() or autoupdate.isLicensed(),"Auto Update features are not licensed when they should be")
Esempio n. 11
0
 def run(self, arglist):
     trigger = AgentTrigger(self.agent)
     server = self.adapter.setUpServer(self.getGuest("server"), "16000")
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.setUserVMUser()
     autoupdate.disable()
     autoupdate.setURL("http://%s:16000" % server.getIP())
     self._shouldNotBePinged(trigger, server)
     autoupdate.enable()
     self._shouldBePinged(trigger, server)
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(autoupdate.isLicensed(),
                            "autoupdate is licensed when it shouldn't be")
     self._shouldNotBePinged(trigger, server)
Esempio n. 12
0
 def run(self, arglist):
     server = self.adapter.setUpServer(self.getGuest("server"), "16000")
     server.createCatalog("99.0.0.0")
     msiHandler = NonCryptoMSIHandler()
     msiHandler.getMSIs(server)
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.enable()
     autoupdate.setURL("http://%s:16000" % server.getIP())
     self.agent.restartAgent()
     xenrt.sleep(200)
     assertions.assertNotNone(autoupdate.checkDownloadedMSI(),
                              "msi has not downloaded")
     assertions.assertFalse(msiHandler.installed(self.win1),
                            "Non cryprographically signed msi installed")
Esempio n. 13
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     path = self.adapter.exportVM(self.win1)
     self.adapter.releaseLicense(self.getDefaultPool())
     self.adapter.importVM(self.win1, self.getHost("RESOURCE_HOST_1"), path)
     vss = self.agent.getLicensedFeature("VSS")
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertFalse(
         vss.isLicensed() or autoupdate.isLicensed(),
         "Agent features are licensed when they shouldn't be")
     path = self.adapter.exportVM(self.win1)
     self.adapter.applyLicense(self.getDefaultPool())
     self.adapter.importVM(self.win1, self.getHost("RESOURCE_HOST_0"), path)
     vss = self.agent.getLicensedFeature("VSS")
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     assertions.assertTrue(
         vss.isLicensed() or autoupdate.isLicensed(),
         "Auto Update features are not licensed when they should be")
Esempio n. 14
0
 def run(self, arglist):
     trigger = AgentTrigger(self.agent)
     server = self.adapter.setUpServer(self.getGuest("server"),"16000")
     self.adapter.applyLicense(self.getDefaultPool())
     autoupdate = self.agent.getLicensedFeature("AutoUpdate")
     autoupdate.disable()
     assertions.assertTrue(autoupdate.checkKeyPresent() and not autoupdate.isActive(),"Xapi does not indicate that AutoUpdate is disabled")
     autoupdate.setUserVMUser()
     assertions.assertFalse(autoupdate.checkKeyPresent(),"DisableAutoUpdate reg key is present")
     self._shouldNotBePinged(trigger, server)
     autoupdate.enable()
     assertions.assertTrue(autoupdate.checkKeyPresent(), "DisableAutoUpdate reg key is not present")
     self._shouldNotBePinged(trigger,server)
     autoupdate.setUserPoolAdmin()
     autoupdate.enable()
     assertions.assertTrue(autoupdate.checkKeyPresent() and autoupdate.isActive(),"Xapi does not indicate that AutoUpdate is enabled")
     autoupdate.setUserVMUser()
     autoupdate.disable()
     assertions.assertTrue(autoupdate.checkKeyPresent() and not autoupdate.isActive(),"registry does not indicate that AutoUpdate is disabled")
     self._shouldNotBePinged(trigger,server)
Esempio n. 15
0
    def checkFeature(self, currentSKU):
        feature = CIFSStorage()
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        featureRestricted = self.licenseFeatureFactory.getFeatureState(
            self.systemObj.master.productVersion, currentSKU, feature)

        # Check flag.
        assertions.assertEquals(
            featureRestricted, featureResctictedFlag,
            "CIFS feature flag was not as expected for sku, %s. Restricted flag: %s. Should be: %s"
            % (currentSKU, featureResctictedFlag, featureRestricted))

        # Check if the CIFS Storage feature is correct.
        enabled = feature.isEnabled(self.systemObj.master)
        assertions.assertEquals(
            not featureRestricted, enabled,
            "CIFS feature was not as expected for sku, %s. CIFS enabled: %s. Should be: %s"
            % (currentSKU, enabled, not featureRestricted))

        # Remove License.
        self.licenseManager.releaseLicense(self.systemObj)

        # Check flag again
        # Should be restricted after removing license.
        featureResctictedFlag = feature.hostFeatureFlagValue(
            self.systemObj.master)
        assertions.assertTrue(
            featureResctictedFlag,
            "CIFS feature flag is not restricted after removing license for sku, %s."
            % (currentSKU))

        # Check if CIFS Storage feature is now not functional.
        enabled = feature.isEnabled(self.systemObj.master)
        assertions.assertFalse(
            enabled,
            "CIFS feature is enabled after removing license for sku, %s." %
            (currentSKU))
Esempio n. 16
0
 def _shouldNotBePinged(self, trigger, server):
     pinged = self._pingServer(trigger, server)
     assertions.assertFalse(pinged,
                            "Server was pinged when it shouldn't be")
Esempio n. 17
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     assertions.assertFalse(vss.isSnapshotPossible(),"VSS Snapshot Taken on Non Serverclass Windows")
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(vss.isSnapshotPossible(), "VSS Snapshot Taken on Non Serverclass Windows")
Esempio n. 18
0
 def run(self, arglist):
     self.adapter.applyLicense(self.getDefaultPool())
     vss = self.agent.getLicensedFeature("VSS")
     assertions.assertTrue(vss.isSnapshotPossible(),"snapshot failed in licensed pool")
     self.adapter.releaseLicense(self.getDefaultPool())
     assertions.assertFalse(vss.isSnapshotPossible(),"snapshot succeeded in unlicensed pool")
Esempio n. 19
0
 def _shouldNotBePinged(self,trigger,server):
     pinged = self._pingServer(trigger,server)
     assertions.assertFalse(pinged,"Server was pinged when it shouldn't be")