summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-03-19 13:47:00 +0100
committerJean Delvare <jdelvare@suse.de>2015-03-19 13:47:00 +0100
commit28d7276f4be91467c144cb89310b31f96d65bd42 (patch)
treea1f34c4057c89eb098032fddb541573dc43ff52e /test
parent2c8246c41cc20ff7b59f69953bfbfa839400e000 (diff)
downloadquilt-28d7276f4be91467c144cb89310b31f96d65bd42.tar.gz
Test backup failure
Add a test case for backup failure to the test suite.
Diffstat (limited to 'test')
-rw-r--r--test/failbackup.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/failbackup.test b/test/failbackup.test
new file mode 100644
index 0000000..37046f7
--- /dev/null
+++ b/test/failbackup.test
@@ -0,0 +1,23 @@
+ $ mkdir patches
+
+ $ quilt new test.diff
+ > Patch %{P}test.diff is now on top
+
+ $ quilt add test.txt
+ > File test.txt added to patch %{P}test.diff
+ $ cat > test.txt
+ < This is test.txt.
+ $ quilt refresh
+ > Refreshed patch patches/test.diff
+
+What happens when refresh fails because of a permission error?
+
+ $ chmod -w patches
+ $ cat > test.txt
+ < This is updated test.txt.
+ $ quilt refresh --backup
+ >~ mv: cannot move [`']?%{P}test.diff'? to [`']?%{P}test.diff~'?: Permission denied
+ $ echo %{?}
+ > 1
+
+ $ chmod +w patches