def test_add_serial_port(self):
        try:
            # create resource pool
            try:
                self.manager.create_resource_pool(name=self.rpname)
            except Manager.ExistenceException:
                pass

            # create vm
            vm = None
            try:
                vm = VirtualMachine(name=self.vmname)
                vm.create(manager=self.manager, host_name=self.host_name, resource_pool_name=self.rpname)
            except Manager.ExistenceException:
                pass

            # add serial port to vm
            try:
                vm.add_serial_port(self.manager, self.host_address, self.host_user, self.host_password)
            except Manager.ExistenceException:
                pass

            # turn vm power on
            vm.power_on(self.manager)

            #turn vm power off
            vm.power_off(self.manager)

        except Manager.CreatorException as error:
            self.assertTrue(False, error.message)
        except Exception as error:
            self.assertTrue(False, error.message)
        finally:
            self.manager.destroy_resource_pool_with_vms(self.rpname, self.host_name)
    def test_create_power_on_power_off_and_destroy(self):
        try:

            # create resource pool
            try:
                self.manager.create_resource_pool(name=self.rpname)
            except Manager.ExistenceException:
                pass

            # create vm
            vm = None
            try:
                vm = VirtualMachine(name=self.vmname)
                vm.create(manager=self.manager, host_name=self.host_name, resource_pool_name=self.rpname)
            except Manager.ExistenceException:
                pass

            # turn vm power on
            vm.power_on(self.manager)

            # turn vm power off
            vm.power_off(self.manager)

            # destroy vm
            try:
                vm.destroy(self.manager)
            except Manager.ExistenceException:
                pass

        except Exception as error:
            self.assertTrue(False, error.message)
        finally:
            self.manager.destroy_resource_pool_with_vms(self.rpname, self.host_name)