0

We have an app.exe that uses another 3rd party installation wizard app, InstallAnywhere, to install our application. It is a text-based wizard - meaning a new shell is spawned (and the child process is executing some java.exe in order for its wizard steps to work) when app.exe -i console in the parent shell is executed.

Can pexpect be used in this case as a kind of question/answer interaction ? We tried it with Hudson but it appears that Hudson can only monitor the parent process and not its child process. When Hudson job kicks off the python script, it starts but fails to begin at step 1 of the wizard - it hangs.

How can we overcome this ?

Thanks

chz
  • 355
  • 1
  • 7
  • 21

1 Answers1

0

If I'm reading this correctly, you want to interact with your executing installer (in this case, using pexpect) during a Hudson job, probably to do automated testing.

I'm thinking that expect may get you where you want to go if you call expect from a shell script (or batch file) that is, in turn, run from Hudson. The script would execute the tests, using your favorite flavor of expect, during which it either exits successfully or fails. Hudson would detect the failure, and you could then react accordingly. Your script, and any expect messages, would write to stdout, which Hudson would collect into your build log.

However, Flexera has a testing framework that allows you to test an installer via JUnit. Look at the bottom of this page. Or check out the JavaDocs.

This might give you more precision than an expect hack. You might even be able to write a Hudson plugin and do way with expect and shell scripts completely.

Update: after looking over the Javadocs, I found that the main class GUIAutomationFixture uses Java's Robot class. This means you probably won't be able to run this class on a headless server. You'll likely need either Windows, or a Linux/Unix box with a working X system.

tdfunk
  • 71
  • 4