I have four web power switches with eight remotely controllable power outlets each, for a total of 32 power outlets. I have a device under test connected to each outlet. These devices under test are networked and have SSH. They’re designed to boot in under two minutes, but they occasionally take up to ten minutes to boot, due to being prototypes in development. They’re also prone to randomly crashing, freezing, or otherwise becoming unresponsive.
I’m looking for a reliable, efficient, automated method of mapping devices to power outlets. My current method is reliable and automated, but it’s pretty slow:
turn off all outlets
for each outlet:
turn outlet on
wait ten minutes
try to connect to all devices
store all responsive devices in a list
turn the outlet off
try to connect to the devices in the responsive list
if any are no longer responsive, map them to this outlet
turn on all outlets
As you can calculate, this takes about ten minutes per outlet, and 10 minutes x 32 is 320 minutes, or over five hours. I feel like there has to be a better way, but I’ve been unable to come up with anything.
Note:
I have a device under test connected to each outlet.) that there is a 1:1 mapping of outlet vs deviceThis sequence essentially reverses yours because that way you just have to wait for 10 minutes (max) once – per cycle, see below.
Quite probably you’ll end up with a list of devices and outlets that’s not mapped yet, so you can repeat this cycle with just the unmapped outlets until there are no outlets are left or until you run out of time.
So, in the very best case (all devices boot up correctly in the normal time) your test will be over in a bit over 2 minutes.