mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-13 22:47:12 +03:00
skip resume test if not supported in userspace
This commit is contained in:
parent
f2b284c407
commit
d19cb2c842
10
basetest.py
10
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
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user