diff --git a/basetest.py b/basetest.py index 404fb95..6975cd0 100644 --- a/basetest.py +++ b/basetest.py @@ -15,6 +15,16 @@ import sys import io TEST_POOLS="test_source1 test_source2 test_target1" +ZFS_USERSPACE= subprocess.check_output("dpkg-query -W zfsutils-linux |cut -f2", shell=True).decode('utf-8').rstrip() +ZFS_KERNEL= subprocess.check_output("modinfo zfs|grep ^version |sed 's/.* //'", shell=True).decode('utf-8').rstrip() + +print("###########################################") +print("#### Unit testing against:") +print("#### Python :"+sys.version.replace("\n", " ")) +print("#### ZFS userspace :"+ZFS_USERSPACE) +print("#### ZFS kernel :"+ZFS_KERNEL) +print("#############################################") + # for python2 compatibility diff --git a/bin/zfs-autobackup b/bin/zfs-autobackup index 4134c86..d8d1dcd 100755 --- a/bin/zfs-autobackup +++ b/bin/zfs-autobackup @@ -1728,7 +1728,7 @@ class ZfsAutobackup: self.debug("Thinning obsolete datasets") for dataset in ZfsDataset(target_node, self.args.target_path).recursive_datasets: if dataset not in target_datasets: - dataset.verbose("Missing on source") + dataset.debug("Missing on source") dataset.thin() diff --git a/run_tests b/run_tests index 7fdb0ea..e3c4558 100755 --- a/run_tests +++ b/run_tests @@ -9,14 +9,6 @@ fi #reactivate python environment, if any (usefull in Travis) [ "$VIRTUAL_ENV" ] && source $VIRTUAL_ENV/bin/activate -echo "####################################################" -echo "##### Unit testing against" -echo "##### Python : `python --version 2>&1 |sed 's/.* //'`" -echo "##### ZFS userspace : `dpkg-query -W zfsutils-linux |cut -f2`" -echo "##### ZFS kernel : `modinfo zfs|grep ^version |sed 's/.* //'` " -echo "####################################################" - - # test needs ssh access to localhost for testing if ! [ -e /root/.ssh/id_rsa ]; then ssh-keygen -t rsa -f /root/.ssh/id_rsa -P '' || exit 1 diff --git a/test_externalfailures.py b/test_externalfailures.py index 14e5481..e8f821f 100644 --- a/test_externalfailures.py +++ b/test_externalfailures.py @@ -11,6 +11,9 @@ class TestZfsNode(unittest2.TestCase): def test_resume(self): + if "0.6.5" in ZFS_USERSPACE: + self.skipTest("Resume not supported in this ZFS userspace version") + r=shelltest("zfs set compress=off test_source1 test_target1") #initial backup @@ -36,10 +39,14 @@ class TestZfsNode(unittest2.TestCase): with OutputIO() as buf: with redirect_stdout(buf): with patch('time.strftime', return_value="20101111000002"): - self.assertFalse(ZfsAutobackup("test test_target1 --verbose --allow-empty".split(" ")).run()) + self.assertFalse(ZfsAutobackup("test test_target1 --verbose --allow-empty --debug".split(" ")).run()) print(buf.getvalue()) + #did we really resume? - self.assertIn("resuming", buf.getvalue()) + self.assertIn(": resuming", buf.getvalue()) + + # def test_resumeabort(self): +