[lnst] NetTestController: Adding check for root priviledges

Jiří Pírko jirka at fedoraproject.org
Fri May 3 09:24:35 UTC 2013


commit 94d6f52e19565f35fb9f176ad76ff41b550dbadf
Author: Radek Pazdera <rpazdera at redhat.com>
Date:   Fri Apr 26 10:11:19 2013 +0200

    NetTestController: Adding check for root priviledges
    
    In case the match is virtual, LNST will need euid == 0 so it can connect
    to qemu and configure the machines. This commit introduces a check for
    that.
    
    Signed-off-by: Radek Pazdera <rpazdera at redhat.com>

 lnst/Controller/NetTestController.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 078746d..62600ca 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -109,6 +109,12 @@ class NetTestController:
             msg = "This setup cannot be provisioned with the current pool."
             raise NetTestError(msg)
 
+        if sp.is_setup_virtual() and os.geteuid() != 0:
+            msg = "Provisioning this setup requires additional configuration "\
+                  "of the virtual machines in the pool. LNST needs root "\
+                  "priviledges so it can connect to qemu."
+            raise NetTestError(msg)
+
         for m_id, machine in machines.iteritems():
             self._machines[m_id] = machine
 


More information about the LNST-developers mailing list