4

I want to do automatic testing of installation of our product on RHEL, Ubuntu and recent Windows. The installer is command-line driven.

It should:

  • check OS version,
  • download according installer,
  • install missing dependencies,
  • generate report.

My first idea was using Expect. Then I did some searching and found that there is RExpect (I am more familiar with Ruby than with Tcl). I also found that there is Aruba in Cucumber for command line testing, though I don’t know how to e.g. check for an OS version.

I would really appreciate recommendation on how to proceed and/or which tool is more suitable for this task.

1
  • Python works great for our installer testing simply because it is so powerful and is able to accomplish each of your requirements. Oct 5, 2017 at 4:18

3 Answers 3

1

Honestly, I wouldn't use a framework at all but instead write down a small python (because I like python, you can use any language you like though) script. You can easily ask for the os you're running on using the os class, download the appropriate installer using urllib and just repeat this for every dependency your AUT throws at you. If it's well designed the error should give you everything you need to resolve it so this shouldn't be too big a deal and you do not have to handle a giant framework for what's essentially just throwing around command lines and not using bash or batch comes with the added bonus that you can run one suite on all operating systems.

1
  • In the end I’ve ruled out frameworks too and I’ve written a collection of small scripts in Tcl. Learning curve was somewhat steeper then I expected but then pieces started to fall in place. Hardest part was deployment of recent Tcl on those old Linux distributions.
    – Mr. Tao
    Sep 8, 2017 at 16:55
0

If something is done as the command line and I want to automate it I usually use a bash shell script

6
  • From my experience shell scripts are brittle and wouldn’t allow me much interaction. Therefore I am more inclined toward Expect-like approach.
    – Mr. Tao
    Apr 6, 2017 at 14:05
  • I've been writing robust shell scripts for 30 years. What specifically is brittle? The language is archaic and cryptic but not brittle in my experience. @Mr.Tao Apr 6, 2017 at 16:41
  • @BharatMane and others in the mafia, this is a tool and answers the question imho. Apr 6, 2017 at 16:42
  • btw I'm a ruby developer but ruby is the wrong tool for installation imho. feels like installation is normally a bunch of command at the command line - and that's what a shell script does. Apr 6, 2017 at 16:51
  • To do anything meaningful in shell you rely on utilities. Each of them handles options differently (mostly depending on where they were conceived – UNIX, BSD, GNU…). Its prone to bashism. I cannot speak for all shells, but at least ksh on Solaris is full of bugs. If I can make a choice, I prefer consistent behavior. Also I am looking for tool to test installation (the installer on Linux indeed is a bunch of shell commands) and I would like to share most of the test script between is’s Linux and Windows versions.
    – Mr. Tao
    Apr 9, 2017 at 18:45
0

I am surprised that http://www.sikuli.org/ is not mentioned yet.

Why Sikuli?

Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is useful when there is no easy access to a GUI's internal or source code.

You will, however, need to script some parts in Python, for example the OS version detection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.