From d2d99a91a0bb47ab4f2116692f363b90a736711b Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Tue, 5 Jul 2016 08:54:51 +0200 Subject: fix swift primary object store test (#25281) * Wait for socket to be open * Fix call on null * Allow DB access for MountProviderTest Makes unit tests pass when using object store, since their FS access is actually oc_filecache DB access. It is currently not possible to mock or bypass the logic from "SharedMount::verifyMountPoint()" triggered by this test. --- tests/objectstore/wait-for-connection | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 tests/objectstore/wait-for-connection (limited to 'tests/objectstore/wait-for-connection') diff --git a/tests/objectstore/wait-for-connection b/tests/objectstore/wait-for-connection new file mode 100755 index 00000000000..2c480fb733e --- /dev/null +++ b/tests/objectstore/wait-for-connection @@ -0,0 +1,45 @@ +#!/usr/bin/php + $timeout) { + $socketTimeout = $timeout; +} + +$stopTime = time() + $timeout; +do { + $sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout); + if ($sock !== false) { + fclose($sock); + fwrite(STDOUT, "\n"); + exit(0); + } + sleep(1); + fwrite(STDOUT, '.'); +} while (time() < $stopTime); + +fwrite(STDOUT, "\n"); +exit(1); -- cgit v1.2.3