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 TST_USE_LEGACY_API=1 22 . tst_net.sh 23 24 do_setup() 25 { 26 tst_resm TINFO "Checking for rusersd on $(tst_ipaddr)" 27 rpcinfo -u $(tst_ipaddr) rusersd > /dev/null 2>&1 || \ 28 tst_brkm TCONF "rusersd is inactive on $(tst_ipaddr)" 29 } 30 31 do_test() 32 { 33 tst_resm TINFO "Test rusers with options set" 34 35 EXPECT_RHOST_PASS rusers $(tst_ipaddr) 36 37 local opts="-a -l" 38 for opt in $opts; do 39 EXPECT_RHOST_PASS rusers $opt $(tst_ipaddr) 40 done 41 42 tst_resm TINFO "Test rusers with bad options" 43 EXPECT_RHOST_FAIL rusers bogushost 44 EXPECT_RHOST_FAIL rusers -bogusflag $(tst_ipaddr) 45 } 46 47 do_setup 48 do_test 49 50 tst_exit 51