Ubuntu Pastebin

Paste from smoser at Mon, 30 Oct 2017 20:51:38 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/tests/cloud_tests/instances/base.py b/tests/cloud_tests/instances/base.py
index 9886cbc6..7550028e 100644
--- a/tests/cloud_tests/instances/base.py
+++ b/tests/cloud_tests/instances/base.py
@@ -22,6 +22,7 @@ class Instance(object):
         self.properties = properties
         self.config = config
         self.features = features
+        self._tmp_count = 0
 
     def execute(self, command, stdout=None, stderr=None, env=None,
                 rcs=None, description=None):
@@ -98,7 +99,7 @@ class Instance(object):
 
         @return_value: path to new file in target
         """
-        return self.execute(['mktemp'])[0].strip()
+        return "/tmp/%s-%04d" % (type(self).__name__, self._tmp_count)
 
     def console_log(self):
         """Instance console.
diff --git a/tests/cloud_tests/instances/nocloudkvm.py b/tests/cloud_tests/instances/nocloudkvm.py
index 8a0e5319..cf5d5715 100644
--- a/tests/cloud_tests/instances/nocloudkvm.py
+++ b/tests/cloud_tests/instances/nocloudkvm.py
@@ -76,7 +76,7 @@ class NoCloudKVMInstance(base.Instance):
             command = ['sh', '-c', command]
 
         if self.pid:
-            return self.ssh(command)
+            return self.ssh(['sudo'] + list(command))
         else:
             return self.mount_image_callback(command) + (0,)
 
Download as text