I’d like to run a test script on dozens of embedded Linux units; in manufacturing the authentication credentials are all the same.
The tests are about an hour, but I’d like each unit to loop continuously (over the weekend say) and report the current iteration of the test (on a per unit basis).
I’m thinking expect might be the way to go (it would certainly help with ssh login), but the online documentation is … uh … a bit too distributed for what seems to be a simple exercise.
I’m stuck at the trying to determine how to spawn my embedded tests in parallel. In BASH I’d use the & operator to put the process on the background, but then entering the authentication is a challenge.
Should I use expect or stick with BASH scripting?
What I did:
Using an expect script I placed an SSH authentication file on the DUT. THE DUT’s have only a RAM file system to play with so this before the rest of the bash script is run. Then, a simple BASH for loop issues an ssh command inside a for loop to run the tests and put the session on a background thread. Comme ca:
for i in <IP devices to test> ;
do
ssh user@$i "echo - \"IP Address: $i :\" ; test-script" &
done
Voila!
Setup ssh public-key authentication (example: http://www.petefreitag.com/item/532.cfm) with blank public key password, then you can use ssh to run these scripts without entering any authorization credential, thus you can write bash scripts to execute them without user intervention