#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=`basename $0` echo "creating config file ..." mkdir etc cat > /tmp/rocon.conf <<'EOF' dione:AllHosts,PC,Linux,Debian,Debian_3_1::: leda:AllHosts,PC,Linux,Debian,Debian_3_1,ACCESSIBLE::: hermes_dual_boot_hpux:AllHosts,HP,HP_C110,HPUX,HPUX_11_00::: hermes_dual_boot_linux:AllHosts,HP,HP_C110,Debian,Debian_3_1::: sirius:AllHosts,PC,Linux,RedHat,RedHat_9::: opus6a:AllHosts,Sun,Solaris,Solaris_8::: jason:AllHosts,PC,Windows,Windows_98::: host-with-hyphen1:group-with-hyphen1 host-with-hyphen2:groupwithouthyphen1 hostwithouthyphen1:group-with-hyphen2 hostwithouthyphen2:groupwithouthyphen2 EOF echo "test 1 (empty config file is acceptable) ..." rocon -F /dev/null -m anything echo "test 2 (non-matching expression is acceptable) ..." rocon -F /tmp/rocon.conf -m NONE echo "test 3 (matching expression) ..." rocon -F /tmp/rocon.conf -m "dione or hermes_dual_boot_linux" echo "test 4 (matching expression) ..." rocon -F /tmp/rocon.conf -m "HP or Debian" echo "test 5 (matching expression) ..." rocon -F /tmp/rocon.conf -m "PC and not sirius and not leda" echo "test 6 (matching expression) ..." rocon -F /tmp/rocon.conf -m "PC and not Linux" echo "test 7 (matching expression) ..." rocon -F /tmp/rocon.conf -m "AllHosts and not HP" echo "test 7.1 (hyphen test using host with hyphen) ..." rocon -F /tmp/rocon.conf -m host-with-hyphen1 echo "test 7.2 (hyphen test using group with hyphen) ..." rocon -F /tmp/rocon.conf -m group-with-hyphen1 echo "test 8 (hyphen test using group with hyphens and returning host with hyphens) ..." rocon -F /tmp/rocon.conf -m group-with-hyphen1 echo "test 9 (hyphen tests using group without hyphens and returning host with hyphens) ..." rocon -F /tmp/rocon.conf -m groupwithouthyphen1 echo "test 10 (hyphen tests using group with hyphens and returning host without hyphens) ..." rocon -F /tmp/rocon.conf -m group-with-hyphen2 echo "test 11 (hyphen tests using group without hyphens and returning host without hyphens) ..." rocon -F /tmp/rocon.conf -m groupwithouthyphen2 echo "all done"