I have a delphi application that relies on SQLite3, a DB engine that's advertised as crash-proof.
So far I was able to make my whole application crash-proof, but now I need to simulate brutal machine reboot / power failure.
Obviously it would crazy/unpractical to brutally reboot my machine 100 times / per day just to conduct this test, so...
I wonder if there's a way to simulate power failure using VirtualBox (or something similar) programmatically / in an automated fashion?
Any other method/thought would be more than welcome, my goal is to make sure my users' data is never corrupted.
PS. This question is for Windows XP or later
Running this on the virtual box host should do the trick
VBoxManage controlvm (vmname) reset/poweroff
VBoxManage controlvm (vmname) reset has the same effect on a virtual machine as pressing the "Reset" button on a real computer: a cold reboot of the virtual machine, which will restart and boot the guest operating system again immediately. The state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the "Reset" item in the "Machine" menu of the GUI.)
VBoxManage controlvm (vmname) poweroff has the same effect on a virtual machine as pulling the power cable on a real computer. Again, the state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the "Close" item in the "Machine" menu of the GUI or pressing the window's close button, and then selecting "Power off the machine" in the dialog.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With