- Disable test (autobuild <-> buildservice incompatibility)
[opensuse:yast-rest-service.git] / rpam / test / fail.rb
1 #
2 # Test failed authentication
3 #
4
5 $:.unshift "../ext/Rpam"
6 require 'test/unit'
7 require 'rpam'
8
9 class LoadTest < Test::Unit::TestCase
10   def test_auth_fail
11     assert !Rpam::authpam("","")
12     # just return false on unknown user
13     assert_nothing_raised { Rpam::authpam("xyzzy", "") }
14 if false
15     if (Process.uid == 0 || (Process.uid==99 && File.exist?("/.buildenv")))
16       # raise (if called as non-root) with known user
17       assert_nothing_raised { Rpam::authpam("root","root") }
18     else
19       # raise (if called as non-root) with known user
20       assert_raise(SecurityError) { Rpam::authpam("root","root") }
21     end
22 end
23   end
24 end