Browse Source

tests: fix qvm-copy-to-vm test

Make the check if remote file wasn't removed meaningful. Previously the
user didn't have permission to remote the source file, so even if the
tool would try, it would fail.
Marek Marczykowski-Górecki 4 years ago
parent
commit
3066190283
1 changed files with 4 additions and 2 deletions
  1. 4 2
      qubes/tests/integ/vm_qrexec_gui.py

+ 4 - 2
qubes/tests/integ/vm_qrexec_gui.py

@@ -943,11 +943,13 @@ class TC_00_AppVMMixin(object):
             self.testvm1.start(),
             self.testvm1.start(),
             self.testvm2.start()]))
             self.testvm2.start()]))
 
 
+        self.loop.run_until_complete(self.testvm1.run_for_stdio(
+            'cp /etc/passwd /tmp/passwd'))
         with self.qrexec_policy('qubes.Filecopy', self.testvm1, self.testvm2):
         with self.qrexec_policy('qubes.Filecopy', self.testvm1, self.testvm2):
             try:
             try:
                 self.loop.run_until_complete(
                 self.loop.run_until_complete(
                     self.testvm1.run_for_stdio(
                     self.testvm1.run_for_stdio(
-                        'qvm-copy-to-vm {} /etc/passwd'.format(
+                        'qvm-copy-to-vm {} /tmp/passwd'.format(
                             self.testvm2.name)))
                             self.testvm2.name)))
             except subprocess.CalledProcessError as e:
             except subprocess.CalledProcessError as e:
                 self.fail('qvm-copy-to-vm failed: {}'.format(e.stderr))
                 self.fail('qvm-copy-to-vm failed: {}'.format(e.stderr))
@@ -961,7 +963,7 @@ class TC_00_AppVMMixin(object):
 
 
         try:
         try:
             self.loop.run_until_complete(self.testvm1.run_for_stdio(
             self.loop.run_until_complete(self.testvm1.run_for_stdio(
-                'test -f /etc/passwd'))
+                'test -f /tmp/passwd'))
         except subprocess.CalledProcessError:
         except subprocess.CalledProcessError:
             self.fail('source file got removed')
             self.fail('source file got removed')