Commit 5d0ca690 authored by Nicolas Wavrant's avatar Nicolas Wavrant

tests/slapgrid: fake socat to pass socat existence check

(c7ebe964)
parent 29023fcc
......@@ -2780,6 +2780,13 @@ class TestSlapgridWithPortRedirection(MasterMixin, unittest.TestCase):
self.port_redirect_path = os.path.join(self.partition.partition_path,
slapmanager.portredir.Manager.port_redirect_filename)
if self._tempdir not in os.environ['PATH']:
fake_socat_bin = os.path.join(self._tempdir, 'socat')
with open(fake_socat_bin, 'w') as f:
f.write('')
os.chmod(fake_socat_bin, stat.S_IRWXU)
os.environ['PATH'] = "%s:%s" % (self._tempdir, os.environ['PATH'])
def _mock_requests(self):
return httmock.HTTMock(self.computer.request_handler)
......
  • wasn't nexedi/slapos@b7fe8bba enough ?

  • In my case I was just git-cloning the repo and running tests by hands, thus there was no socat in my PATH. If using the egg test suite to run tests, then this commit isn't useful. Still, I like to be able to just get the egg to fix code / test, and not having to wait for the setup of a software release to fix or develop simple things.

  • I see, thanks for explanation. I don't know this test so I cannot really say, of course if the test assert that the tunnel is functional, then a real socat is needed.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment