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()
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.")
def run(self, arglist): self.adapter.applyLicense(self.getDefaultPool()) autoupdate = self.agent.getLicensedFeature("AutoUpdate") autoupdate.enable() autoupdate.setURL("http://localhost:55555") self.agent.restartAgent() xenrt.sleep(60) assertions.assertTrue(self.agent.isAgentAlive(), "Agent Stopped")
def run(self, arglist): self.adapter.applyLicense(self.getDefaultPool()) self.adapter.lowerDotNetAgentVersion(self.win1) autoupdate = self.agent.getLicensedFeature("AutoUpdate") autoupdate.enable() xenrt.sleep(60) assertions.assertNotNone(autoupdate.checkDownloadedMSI(), "MSI did not download") assertions.assertTrue(autoupdate.compareMSIArch(),"Downloaded MSI is wrong architecture")
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")
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")
def run(self, arglist): self.adapter.applyLicense(self.getDefaultPool()) self.adapter.lowerDotNetAgentVersion(self.win1) autoupdate = self.agent.getLicensedFeature("AutoUpdate") autoupdate.enable() xenrt.sleep(60) assertions.assertNotNone(autoupdate.checkDownloadedMSI(), "MSI did not download") assertions.assertTrue(autoupdate.compareMSIArch(), "Downloaded MSI is wrong architecture")
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")
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")
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)
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")
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))
def checkFeature(self, currentSKU): self.systemObj.master.execdom0("xe host-license-view") feature = WorkloadBalancing() 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)) self.licenseManager.releaseLicense(self.systemObj) self.systemObj.master.execdom0("xe host-license-view") featureResctictedFlag = feature.hostFeatureFlagValue( self.systemObj.master) assertions.assertTrue( featureResctictedFlag, "Feature flag is not restricted after removing license. Feature restricted: %s" % (featureResctictedFlag))
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)
def _shouldBePinged(self, trigger, server): pinged = self._pingServer(trigger, server) assertions.assertTrue(pinged, "Server was not pinged when it should be")
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")
def _shouldBePinged(self,trigger,server): pinged = self._pingServer(trigger,server) assertions.assertTrue(pinged,"Server was not pinged when it should be")