1 #!/bin/sh 2 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved. 3 # Copyright (c) International Business Machines Corp., 2000 4 # 5 # This program is free software; you can redistribute it and/or 6 # modify it under the terms of the GNU General Public License as 7 # published by the Free Software Foundation; either version 2 of 8 # the License, or (at your option) any later version. 9 # 10 # This program is distributed in the hope that it would be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 TCID="rusers01" 19 TST_TOTAL=5 20 21 . test_net.sh 22 23 do_setup() 24 { 25 tst_resm TINFO "Checking for rusersd on $(tst_ipaddr)" 26 rpcinfo -u $(tst_ipaddr) rusersd > /dev/null 2>&1 || \ 27 tst_brkm TCONF "rusersd is inactive on $(tst_ipaddr)" 28 } 29 30 do_test() 31 { 32 tst_resm TINFO "Test rusers with options set" 33 34 EXPECT_RHOST_PASS rusers $(tst_ipaddr) 35 36 local opts="-a -l" 37 for opt in $opts; do 38 EXPECT_RHOST_PASS rusers $opt $(tst_ipaddr) 39 done 40 41 tst_resm TINFO "Test rusers with bad options" 42 EXPECT_RHOST_FAIL rusers bogushost 43 EXPECT_RHOST_FAIL rusers -bogusflag $(tst_ipaddr) 44 } 45 46 do_setup 47 do_test 48 49 tst_exit 50