Blob Blame History Raw
From f9e0da521a871d9e3b05116bc7dc844a44284051 Mon Sep 17 00:00:00 2001
Message-Id: <f9e0da521a871d9e3b05116bc7dc844a44284051.1386348946.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Thu, 28 Nov 2013 15:42:54 +0100
Subject: [PATCH] tests: Don't test user config file if ran as root

https://bugzilla.redhat.com/show_bug.cgi?id=1034380

(cherry picked from commit a1db95d0fe5d898b4098ad59a670878906af8199)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 tests/virsh-uriprecedence | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence
index f4d84a4..f9e3256 100755
--- a/tests/virsh-uriprecedence
+++ b/tests/virsh-uriprecedence
@@ -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"
-- 
1.8.4.5