aspose file tools*
The moose likes Testing and the fly likes Automating Command Line installation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Automating Command Line installation" Watch "Automating Command Line installation" New topic
Author

Automating Command Line installation

Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
Hi,
We have a software which can be installed on command line. So when you run the install script, based on the user environment it will ask few questions and then install the software. I am trying to automate the testing of the install script. The software is primariy installed on UNIX platforms. so what is the best way to automate this. Also if you know of any reference url please let me know

Regards,
Satish
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Could you tell us what kind of things should the installation script do?
If it's ok for the installation script test to actually alter the environment (by installing your software), it should be pretty easy to do assertions against the environment ("does that directory exist with these three files?", etc.)


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
Could you tell us what kind of things should the installation script do?
If it's ok for the installation script test to actually alter the environment (by installing your software), it should be pretty easy to do assertions against the environment ("does that directory exist with these three files?", etc.)

When I run the install on the command line the script generates questions based on the software installed on the user paltform. My automated script should be able to provide answers to those questions and then verify if the installation is successfully. To verify if the installation is successfully I can just check for a process but what I need help is on how to provide the answers to the questions prompted by the install script?

What is the best programming/scripting language. Any reference to a website for more assistance would be good.

Regards,
Satish
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You can write this sort of a test quite well with Java but a shell scripting language such as Bash could be an even better match (unless you want to be able to run those tests within your IDE, for example, in which case a JUnit test would probably be your best option).

The installation script is apparently expecting the user input from stdin a.k.a. System.in, which means that you could do something like this:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Automating Command Line installation