Problem
How to use robtest commands from the command line with no user intervention required
Solution
/usr/openv/volmgr/bin/robtest calls a separate utility to run the commands against the robot.
For instance it you have a Tape Library DLT robot, it calls tldtest.
For an Automated Cartridge System Library Software (ACSLS) controlled robot, it calls acstest.
When robtest is started and a robot is selected, the appropriate utility is called:
%robtest
Configured robots with local control supporting test utilities:
TS8(0) robotic path = /dev/sg/c0t1l0
TLD(1) robotic path = /dev/sg/c1t2l0
TLD(2) robotic path = filer:mc0
Robot Selection
---------------
1) TS8 0
2) TLD 1
3) TLD 2
4) none/quit
Enter choice: 2
Robot selected: TLD(1) robotic path = /dev/sg/c1t2l0
invoking robotic test utility:
/usr/openv/volmgr/bin/tldtest -r /dev/sg/c1t2l0 -d1 /dev/rmt/4cbn -d2 /dev/rmt/5cbn -d3 /dev/rmt/2cbn -d4 /dev/rmt/3cbn
Opening /dev/sg/c1t2l0
MODE_SENSE complete
Enter tld commands (? returns help information)
Any command that can be run at this point, can be run by echoing it and piping the command to the device the utility (in this case tldtest) opened.
For example to check the status of the slots in this robot, the command would be:
echo "s s" | /usr/openv/volmgr/bin/tldtest -r /dev/sg/c1t2l0
with the result:
Opening /dev/sg/c1t2l0
MODE_SENSE complete
Enter tld commands (? returns help information)
slot 1 (addr 1000) contains Cartridge = yes
Source address = 10
Barcode = FX0023
slot 2 (addr 1001) contains Cartridge = yes
Source address = 502
Barcode = 000014
slot 3 (addr 1002) contains Cartridge = yes
Source address = 502
Barcode = 000002
slot 4 (addr 1003) contains Cartridge = yes
Source address = 503
READ_ELEMENT_STATUS complete
To check the status of the drives, the command would be run this way:
echo "s d" | /usr/openv/volmgr/bin/tldtest -r /dev/sg/c1t2l0
with the result:
Opening /dev/sg/c1t2l0
MODE_SENSE complete
Enter tld commands (? returns help information)
drive 1 (addr 500) access = 1 Contains Cartridge = yes
Source address = 1044 (slot 45)
Barcode = RBS324
SCSI ID from drive 1 is 1
drive 2 (addr 501) access = 1 Contains Cartridge = no
SCSI ID from drive 2 is 2
drive 3 (addr 502) access = 1 Contains Cartridge = no
drive 4 (addr 503) access = 1 Contains Cartridge = no
READ_ELEMENT_STATUS complete
To determine what commands can be echoed in this way, enter "?" under robtest for a command usage explanation.