~ubuntu-branches/ubuntu/trusty/duplicity/trusty

« back to all changes in this revision

Viewing changes to testing/manual/manual-ctrl-c-test.sh

  • Committer: Package Import Robot
  • Author(s): Michael Terry
  • Date: 2011-12-06 14:15:01 UTC
  • mfrom: (1.9.4)
  • Revision ID: package-import@ubuntu.com-20111206141501-nvfaaauqivpwyb7f
Tags: 0.6.17-0ubuntu1
* New upstream release
* debian/patches/06_use_passphrase.dpatch,
  debian/patches/07_large_rackspace_list.dpatch,
  debian/patches/08_check_volumes.dpatch:
  - Dropped, applied upstream
* debian/rules:
  - Run new upstream test suite during build
* debian/control:
  - Add rdiff as a build-dep to run above test suite
* debian/patches/06testfixes.dpatch:
  - Fix a few tests to not fail erroneously
* debian/patches/07fixincresume.dpatch:
  - Fix a bug with resuming an incremental backup that would result in
    a bogus error.  Also patches in a test for it.
* debian/tests/full-cycle-local:
  - New DEP-8 test script that backs up locally, restores, and checks files
* debian/tests/full-cycle-u1:
  - New DEP-8 test script that does the same as above, but to Ubuntu One
* debian/tests/control:
  - Start of DEP-8 test suite.  Only enable above full-cycle-local test
    for automatic execution.  The other is for manual testing right now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Check permissions
 
4
if [ "`id -ur`" != '0' ]; then
 
5
    echo 'Error: you must be root.'
 
6
    exit 1
 
7
fi
 
8
 
 
9
cd /tmp
 
10
rm -rf backup* restore*
 
11
 
 
12
cd ~/workspace/duplicity-0.6-series
 
13
echo "***** Do not disturb the control backup! "
 
14
PASSPHRASE=foo ./bin/duplicity --exclude="**/udev/devices/*" --name=test-backup1 /lib file:///tmp/backup1
 
15
 
 
16
echo -n "***** Now hit Ctrl-C at random intervals.  Hit any key to continue... "
 
17
read -e DUMMY
 
18
echo
 
19
 
 
20
trap "pkill -INT duplicity" SIGINT
 
21
 
 
22
RC=4
 
23
while [ "$RC" == "4" ]; do
 
24
    PASSPHRASE=foo ./bin/duplicity --exclude="**/udev/devices/*" --name=test-backup2 -v5 /lib file:///tmp/backup2
 
25
    RC=$?
 
26
    echo "Exit == $RC"
 
27
    if [ "$RC" != "4" ] && [ "$RC" != "0" ]; then
 
28
        echo "Repeat? "
 
29
        read -e REPLY
 
30
        if [ "$REPLY" == "Y" ] || [ "$REPLY" == "y" ]; then
 
31
            continue
 
32
        else
 
33
            break
 
34
        fi
 
35
    fi
 
36
done
 
37
 
 
38
trap - SIGINT
 
39
 
 
40
echo "Restoring backups..."
 
41
PASSPHRASE=foo ./bin/duplicity --name=test-backup1 file:///tmp/backup1 /tmp/restore1
 
42
PASSPHRASE=foo ./bin/duplicity --name=test-backup2 file:///tmp/backup2 /tmp/restore2
 
43
 
 
44
echo "Diff between /lib and /tmp/restore1"
 
45
diff -qr /lib /tmp/restore1 | grep -v "Only in /lib/udev/devices"
 
46
 
 
47
echo "Diff between /tmp/restore1 and /tmp/restore2"
 
48
diff -qr /tmp/restore1 /tmp/restore2