]> git.ipfire.org Git - thirdparty/libvirt.git/commit
test driver: Add authentication to test driver.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 8 Jan 2014 18:32:48 +0000 (18:32 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 8 Jan 2014 20:12:23 +0000 (20:12 +0000)
commite093351209a4937631ec70d6007b096c6754dcce
tree754a2955a0119679c6461d53045c3897adbb2d4a
parent459532b4f781b182e4f7459be75449b3906dd645
test driver: Add authentication to test driver.

There is no easy way to test authentication against libvirt.  This
commit modifies the test driver to allow simple username/password
authentication.

You modify the test XML by adding:

 <node>
   ...
   <auth>
     <user password="123456">rich</user>
     <user>jane</user>
   </auth>
 </node>

If there are any /node/auth/user elements, then authentication is
required by the test driver (if none are present, then the test driver
will work as before and not require authentication).

In the example above, two phony users are added:

 rich  password: 123456
 jane  no password required

The test driver will demand a username.  If the password attribute is
present (or if the username entered is wrong), then the password is
also asked for and checked:

 $ virsh -c test://$(pwd)/testnode.xml list
 Enter username for localhost: rich
 Enter rich's password for localhost: ***
  Id    Name                           State
 ----------------------------------------------------
  1     fv0                            running
  2     fc4                            running

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
src/test/test_driver.c