Test environment for Virtualmin install scripts?

3 posts / 0 new
Last post
#1 Mon, 06/25/2012 - 19:00
glenvistalabs

Test environment for Virtualmin install scripts?

I'm in the middle of (re-)writing a Virtualmin installer script. What is frustrating me is that there does not seem to be any method (I've searched around) of testing the script, i.e. to debug it, apart from uploading it, running it, looking at the output, removing the script file and starting over. The entire process of testing the script takes at least thirty seconds (and requires actually downloading the package from Sourceforge), which for my purposes is completely unacceptable and will inevitably cost me many hours of time that I don't have.

Is there any way to set up a test environment for Virtualmin installer scripts, i.e. where the API is available and I can specify inputs for test cases? Or am I stuck having to delete and re-upload it after every small change I make when I need to test that it works?

Mon, 06/25/2012 - 22:24
JamieCameron

I'd advise using the Virtualmin command-line API to test your script .. it is much faster than using the web UI, and you can make the install print debugging information to STDERR. You can use a command like :

virtualmin install-script --domain yourdomain.com --type yourscript --version latest --path /yourscript --db mysql yourdomain

and to remove before re-installing, you can run something like :

virtualmin delete-script --domain yourdomain.com --type yourscript

Also, packages shouldn't need to be re-downloaded from sourceforge each time, assuming you have caching turned on in Webmin. This can be set at Webmin -> Webmin -> Webmin Configuration -> Proxy Servers and Downloads -> Downloading -> Cache downloaded files.

''

Mon, 06/25/2012 - 23:23 (Reply to #2)
glenvistalabs

Thank you kindly, that looks like an excellent solution! I had no idea that a script could be run in that manner.

Topic locked