make unittest compatible with old versions of du that don't offer the --output option
authorGerd von Egidy <gerd.von.egidy@intra2net.com>
Thu, 17 Dec 2015 10:53:00 +0000 (11:53 +0100)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Thu, 17 Dec 2015 10:53:00 +0000 (11:53 +0100)
test/test_filefunc.cpp

index e1d68fd..65fa92d 100644 (file)
@@ -600,7 +600,7 @@ BOOST_AUTO_TEST_CASE(FreeDiskSpace1)
     int retries = 5;
     while (retries > 0)
     {
-        string dfstr=capture_exec("df -B 1 --output=avail /tmp | tail -n 1");
+        string dfstr=capture_exec("df -B 1 /tmp | tail -n 1 | sed -e \"s/[^ ]* *[^ ]* [^ ]* *\\([^ ]*\\).*/\\1/\"");
 
         dfout=-1;
         string_to<long long>(dfstr,dfout);