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,)