예제 #1
0
 protected override void Run()
 {
     Description = String.Format(Messages.ACTION_VM_DELETE_SNAPSHOT_TITLE, m_Snapshot.Name());
     if (m_Snapshot.power_state == vm_power_state.Suspended)
     {
         XenAPI.VM.hard_shutdown(Session, m_Snapshot.opaque_ref);
     }
     VMDestroyAction.DestroyVM(Session, m_Snapshot, true);
     Description = String.Format(Messages.SNAPSHOT_DELETED, m_Snapshot.Name());
 }
예제 #2
0
        //Test that if the DestroyVM static method used by VMWizard or Delete snapshot it only deletes owner==true actions
        public void VMDeleteActionDeleteOneTest()
        {
            mockProxy.Setup(x => x.vm_destroy(It.IsAny <string>(), "testvm")).Returns(new Response <string>(""));
            mockProxy.Setup(x => x.vdi_destroy(It.IsAny <string>(), "1")).Returns(new Response <string>(""));
            VM vm = GetVM();

            VMDestroyAction.DestroyVM(new Session(mockProxy.Object, vm.Connection), vm, true);
            mockProxy.VerifyAll();
            mockProxy.Verify(x => x.vdi_destroy(It.IsAny <string>(), It.IsAny <string>()), Times.Once());
        }