tests: Don't test user config file if ran as root
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 12 Sep 2013 10:15:23 +0000 (12:15 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 13 Sep 2013 08:25:56 +0000 (10:25 +0200)
tests/virsh-uriprecedence

index f4d84a4..f9e3256 100755 (executable)
@@ -56,7 +56,11 @@ bad_uri="test:///default?bad_uri"
 good_uri="test:///default?good_uri"
 
 printf "uri_default=\"%s\"\n" "$good_uri" >"$XDG_CONFIG_HOME/libvirt/libvirt.conf"
-test_uri "User config file"
+if uid_is_privileged_; then
+    test_skip_case "$counter" "User config file" "must not be run as root"
+else
+    test_uri "User config file"
+fi
 
 printf "uri_default=\"%s\"\n" "$bad_uri" >"$XDG_CONFIG_HOME/libvirt/libvirt.conf"
 export LIBVIRT_DEFAULT_URI="$good_uri"