rusers01.sh 1.4 KB

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