skip resume test if not supported in userspace

This commit is contained in:
Edwin Eefting 2020-07-08 18:29:02 +02:00
parent f2b284c407
commit d19cb2c842
4 changed files with 20 additions and 11 deletions

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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):