Exemplo n.º 1
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Enable RDP on the guest 
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI failed to enable the RDP on the guest %s with tools installed" % (self.guest))
        xenrt.TEC().logverbose("XAPI successfully enabled the RDP for the guest: %s " % (self.guest))

        # win_guest_agent takes at max 10 seconds to update RDP status change to XAPI
        xenrt.sleep(10)

        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated  data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))

        # Disable the RDP on the guest 
        step("Test trying to disable RDP on the guest by setting  windows registry key fDenyTSConnections to 1")
        self.guest.winRegAdd('HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\', 'fDenyTSConnections',"DWORD", 1)
        xenrt.sleep(10)

        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))

        self.guest.checkHealth()
Exemplo n.º 2
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Disable the RDP on the guest.
        step(" Test is trying to set fDenyTSConnections on the guest to disable RDP")
        self.guest.winRegAdd('HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\', 'fDenyTSConnections',"DWORD", 1)
        xenrt.sleep(10)

        # Make sure RDP disabled field updated.
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))

        # Take snapshot of the guest
        step("Test trying to take the snapshot( memory+disk ) of the guest")
        checkpoint = self.guest.checkpoint()

        # Enable the RDP on the guest
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI failed to enable the RDP on the guest %s with tools installed" % (self.guest))
        xenrt.TEC().logverbose("XAPI successfully enabled the RDP for the guest: %s " % (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated 
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))

        # Revert to snapshot
        step("Test reverting the guest snapshot")
        self.guest.revert(checkpoint)
        self.guest.resume()

        # When we revert to snapshot RDP should be in disabled state
        # We wait 60mins hoping data/ts will be updated by the guest agent
        started = xenrt.timenow()
        finishat = started + 3600
        while finishat > xenrt.timenow() and xapiRdpObj.isRdpEnabled():
            xenrt.sleep(10)
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent for %s not updated the data/ts until 60 mins after reverting to snapshot" % (self.guest))
        xenrt.TEC().logverbose("Guest agent for %s took %d seconds to update data/ts after reverting to snapshot" % (self.guest,xenrt.timenow()-started))

        # Enable the RDP 
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI failed to enable the RDP on the guest %s with tools installed" % (self.guest))
        xenrt.TEC().logverbose("XAPI successfully enabled the RDP for the guest: %s " % (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated 
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))

        self.guest.checkHealth()
Exemplo n.º 3
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        #Disable RDP
        self.guest.winRegAdd(
            'HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\',
            'fDenyTSConnections', "DWORD", 1)
        xenrt.sleep(10)

        # Check that XAPI can switch RDP with tools installed
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI failed to enable the RDP on the guest %s with tools installed "
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI successfully enabled the RDP for the guest: %s " %
            (self.guest))

        # win_guest_agent takes at max 10 seconds to update RDP status to data/ts
        xenrt.sleep(10)

        # Ensure that data/ts updated with latest RDP status
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated  data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))
Exemplo n.º 4
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Enable RDP on the guest
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI failed to enable the RDP on the guest %s with tools installed"
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI successfully enabled the RDP for the guest: %s " %
            (self.guest))

        # win_guest_agent takes at max 10 seconds to update RDP status change to XAPI
        xenrt.sleep(10)

        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated  data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))

        # Disable the RDP on the guest
        step(
            "Test trying to disable RDP on the guest by setting  windows registry key fDenyTSConnections to 1"
        )
        self.guest.winRegAdd(
            'HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\',
            'fDenyTSConnections', "DWORD", 1)
        xenrt.sleep(10)

        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))

        self.guest.checkHealth()
Exemplo n.º 5
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Check that RDP field is not exist in xenstore on the guest with no tools installed
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "RDP is enabled on the guest: %s with no tools" % (self.guest))
        xenrt.TEC().logverbose("RDP is currently disabled on the guest %s" %
                               (self.guest))

        # Check that XAPI can not switch RDP with no tools installed
        if xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI enabled the RDP for the guest %s with no tools." %
                (self.guest))
        xenrt.TEC().logverbose(
            "XAPI couldn't enabled RDP for the guest %s with no tools" %
            (self.guest))

        # Enable the RDP on the guest
        step(
            " Test is trying to enable the RDP on the guest by resetting fDenyTSConnections to 0"
        )
        self.guest.winRegAdd(
            'HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\',
            'fDenyTSConnections', "DWORD", 0)
        xenrt.sleep(10)

        #Install tools
        self.guest.installDrivers()

        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "After tools installation previous RDP settings lost on the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "RDP settings made before new tools installation preserved on the guest %s"
            % (self.guest))
Exemplo n.º 6
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Check that RDP field is not exist in xenstore on the guest with no tools installed
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("RDP is enabled on the guest: %s with no tools" % (self.guest))
        xenrt.TEC().logverbose("RDP is currently disabled on the guest %s" % (self.guest))

        # Check that XAPI can not switch RDP with no tools installed
        if xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI enabled the RDP for the guest %s with no tools." % (self.guest))
        xenrt.TEC().logverbose("XAPI couldn't enabled RDP for the guest %s with no tools" % (self.guest))

         # Enable the RDP on the guest
        step(" Test is trying to enable the RDP on the guest by resetting fDenyTSConnections to 0")
        self.guest.winRegAdd('HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\', 'fDenyTSConnections',"DWORD", 0)
        xenrt.sleep(10)

        #Install tools 
        self.guest.installDrivers()

        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("After tools installation previous RDP settings lost on the guest %s " % (self.guest))
        xenrt.TEC().logverbose("RDP settings made before new tools installation preserved on the guest %s" % (self.guest))
Exemplo n.º 7
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)
        
        #Disable RDP
        self.guest.winRegAdd('HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\', 'fDenyTSConnections',"DWORD", 1)
        xenrt.sleep(10)

        # Check that XAPI can switch RDP with tools installed
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI failed to enable the RDP on the guest %s with tools installed " % (self.guest))
        xenrt.TEC().logverbose("XAPI successfully enabled the RDP for the guest: %s " % (self.guest))
    
        # win_guest_agent takes at max 10 seconds to update RDP status to data/ts
        xenrt.sleep(10)

        # Ensure that data/ts updated with latest RDP status
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("Guest agent does not updated  data/ts about the RDP status change for the guest %s " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))
Exemplo n.º 8
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        #install old tools
        self.guest.installDrivers(source=self.oldTools, expectUpToDate=False)

        if xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI enabled the RDP on the guest %s with old tools installed"
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI couldn't enabled the RDP for the guest %s with old tools installed "
            % (self.guest))

        #Upgrade the tools to latest
        step("Test trying to upgrade the tools")
        self.guest.installDrivers()

        step(
            "Test trying to enable RDP via XAPI on the guest with upgraded tools.."
        )
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI failed to enable RDP for the guest %s with upgraded tools"
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI enabled the RDP for the guest %s with upgraded tools " %
            (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "data/ts not updated for the guest %s with upgraded tools " %
                (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))
Exemplo n.º 9
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        #install old tools 
        self.guest.installDrivers(source=self.oldTools,expectUpToDate=False) 
 
        if xapiRdpObj.enableRdp(): 
            raise xenrt.XRTFailure("XAPI enabled the RDP on the guest %s with old tools installed" % (self.guest)) 
        xenrt.TEC().logverbose("XAPI couldn't enabled the RDP for the guest %s with old tools installed " % (self.guest)) 

        #Upgrade the tools to latest
        step("Test trying to upgrade the tools")
        self.guest.installDrivers()

        step("Test trying to enable RDP via XAPI on the guest with upgraded tools..")
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure("XAPI failed to enable RDP for the guest %s with upgraded tools" % (self.guest))
        xenrt.TEC().logverbose("XAPI enabled the RDP for the guest %s with upgraded tools " % (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated 
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure("data/ts not updated for the guest %s with upgraded tools " % (self.guest))
        xenrt.TEC().logverbose("Guest agent updated the RDP status in data/ts successfully for the guest %s" % (self.guest))
Exemplo n.º 10
0
    def run(self, arglist=None):
        xapiRdpObj = XapiRdp(self.guest)

        # Disable the RDP on the guest.
        step(
            " Test is trying to set fDenyTSConnections on the guest to disable RDP"
        )
        self.guest.winRegAdd(
            'HKLM', 'System\\CurrentControlSet\\Control\\Terminal Server\\',
            'fDenyTSConnections', "DWORD", 1)
        xenrt.sleep(10)

        # Make sure RDP disabled field updated.
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))

        # Take snapshot of the guest
        step("Test trying to take the snapshot( memory+disk ) of the guest")
        checkpoint = self.guest.checkpoint()

        # Enable the RDP on the guest
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI failed to enable the RDP on the guest %s with tools installed"
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI successfully enabled the RDP for the guest: %s " %
            (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))

        # Revert to snapshot
        step("Test reverting the guest snapshot")
        self.guest.revert(checkpoint)
        self.guest.resume()

        # When we revert to snapshot RDP should be in disabled state
        # We wait 60mins hoping data/ts will be updated by the guest agent
        started = xenrt.timenow()
        finishat = started + 3600
        while finishat > xenrt.timenow() and xapiRdpObj.isRdpEnabled():
            xenrt.sleep(10)
        if xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent for %s not updated the data/ts until 60 mins after reverting to snapshot"
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent for %s took %d seconds to update data/ts after reverting to snapshot"
            % (self.guest, xenrt.timenow() - started))

        # Enable the RDP
        if not xapiRdpObj.enableRdp():
            raise xenrt.XRTFailure(
                "XAPI failed to enable the RDP on the guest %s with tools installed"
                % (self.guest))
        xenrt.TEC().logverbose(
            "XAPI successfully enabled the RDP for the guest: %s " %
            (self.guest))
        xenrt.sleep(10)

        # Make sure RDP enabled field updated
        if not xapiRdpObj.isRdpEnabled():
            raise xenrt.XRTFailure(
                "Guest agent does not updated data/ts about the RDP status change for the guest %s "
                % (self.guest))
        xenrt.TEC().logverbose(
            "Guest agent updated the RDP status in data/ts successfully for the guest %s"
            % (self.guest))

        self.guest.checkHealth()