summaryrefslogtreecommitdiff
path: root/tickets/e59b12e505414dca95340858b8360d6e/Maildir/new/1455999005.M237802P17339Q151.exolobe1
blob: 3e015986358a40a060c7f01927f9b6c77ac81433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
Return-Path: <obnam-dev-bounces@obnam.org>
X-Original-To: distix@pieni.net
Delivered-To: distix@pieni.net
Received: from bagpuss.pepperfish.net (bagpuss.pepperfish.net [148.251.8.16])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pieni.net (Postfix) with ESMTPS id 184C1201C5
	for <distix@pieni.net>; Tue, 25 Nov 2014 21:50:22 +0100 (CET)
Received: from platypus.pepperfish.net (unknown [10.112.100.20])
	by bagpuss.pepperfish.net (Postfix) with ESMTP id 73F8939D8;
	Tue, 25 Nov 2014 20:50:21 +0000 (GMT)
Received: from localhost ([::1] helo=platypus.pepperfish.net)
	by platypus.pepperfish.net with esmtp (Exim 4.80 #2 (Debian))
	id 1XtN41-0006nw-9c; Tue, 25 Nov 2014 20:50:21 +0000
Received: from inmail ([10.112.100.10] helo=mx0.pepperfish.net)
 by platypus.pepperfish.net with esmtp (Exim 4.80 #2 (Debian))
 id 1XtN3z-0006ni-Fo
 for <obnam-dev@obnam.org>; Tue, 25 Nov 2014 20:50:19 +0000
Received: from mail-wg0-f42.google.com ([74.125.82.42])
 by mx0.pepperfish.net with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:128)
 (Exim 4.80) (envelope-from <damien.courousse@gmail.com>)
 id 1XtN3w-0000Qa-J8
 for obnam-dev@obnam.org; Tue, 25 Nov 2014 20:50:19 +0000
Received: by mail-wg0-f42.google.com with SMTP id z12so1960452wgg.29
 for <obnam-dev@obnam.org>; Tue, 25 Nov 2014 12:50:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=message-id:date:from:user-agent:mime-version:to:subject
 :content-type; bh=OogVOzEAw3pL8XeLG1V6P1r6J+rfo1qjaHLhH3IdB3Q=;
 b=IwyQvLM1Ahv0xsCtHAAqWqij9PskIxXyMHc/7Sy9egUgSqO4rfzIjm9duwmbZrx8Tt
 nMW8NUApgnmcR0rtu6nl45ivn8tJxSJPPVu/nsU9jmyzVwIAiys6vx9iOuWnauxEtxU8
 ziXJtyEAiILlKkgV68t6mJnwU7lExVgr4uPhrbJV8FB9Lj2nBj9aIEAamh3S7wGanQnc
 f/mbrhsNSWSib/Gxe7/7TR6zVI3hrE67ylc7zMtOcZ3VPnnLY0x7dkpH8nav3dODC0Dt
 80fVzrMLYIocTBd3G3VQHNuvPkGCbiInMfzkCHJUWa4CADoTLwMbia8TJRcucIjalGvD
 Ab/g==
X-Received: by 10.180.74.146 with SMTP id t18mr19866752wiv.62.1416948609574;
 Tue, 25 Nov 2014 12:50:09 -0800 (PST)
Received: from [192.168.0.2] (dra38-9-78-249-57-166.fbx.proxad.net.
 [78.249.57.166])
 by mx.google.com with ESMTPSA id fo12sm18022609wic.19.2014.11.25.12.50.08
 for <obnam-dev@obnam.org>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 25 Nov 2014 12:50:08 -0800 (PST)
Message-ID: <5474EB7F.7040801@gmail.com>
Date: Tue, 25 Nov 2014 21:50:07 +0100
From: =?UTF-8?B?RGFtaWVuIENvdXJvdXNzw6k=?= <damien.courousse@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:31.0) Gecko/20100101 Icedove/31.2.0
MIME-Version: 1.0
To: obnam-dev@obnam.org
Content-Type: multipart/mixed; boundary="------------020901010203030801020405"
X-Spam-Score: -1.0
X-Spam-Score-int: -9
X-Spam-Bar: -
X-Scanned-By: pepperfish.net, Tue, 25 Nov 2014 20:50:19 +0000
X-Spam-Report: Content analysis details: (-1.0 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.5 PPF_USER_AGENT         User-Agent: exists
 1.0 PPF_FROM_CONTAINS_MAIL The From header contains 'mail'
 1.2 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (damien.courousse[at]gmail.com)
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [74.125.82.42 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
Subject: how to test failure with yarn ?
X-BeenThere: obnam-dev@obnam.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Obnam development discussions <obnam-dev-obnam.org>
List-Unsubscribe: <http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org>,
 <mailto:obnam-dev-request@obnam.org?subject=unsubscribe>
List-Archive: <http://listmaster.pepperfish.net/pipermail/obnam-dev-obnam.org>
List-Post: <mailto:obnam-dev@obnam.org>
List-Help: <mailto:obnam-dev-request@obnam.org?subject=help>
List-Subscribe: <http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org>,
 <mailto:obnam-dev-request@obnam.org?subject=subscribe>
Sender: obnam-dev-bounces@obnam.org
Errors-To: obnam-dev-bounces@obnam.org

This is a multi-part message in MIME format.
--------------020901010203030801020405
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

While trying to chase the "Value Error" bug that I still sometimes
experience, I considered implementing some yarn tests for the "full
filesystem" test case [1].

As far as I understand this test case however, I would need to have
obnam fail a backup at some point, which does not seem to be supported
in yarn yet. Is it possible ?

Please find attached a draft attempt of implementation with yarn.
It produces the following :


$ yarn -s yarns/obnam.sh yarns/9000-implements.yarn
yarns/0030-basics.yarn  -r "Backup over a full disk"
ERROR: In scenario "Backup over a full disk"

step "THEN user U fails the backup of directory L to repository R" failed,
with exit code 1:

(...)
    ERROR: Can't back up
/tmp/tmpqgZNqF/Backup_over_a_full_disk/datadir/L/0/0/0/39: RCE08AX: I/O
error: /tmp/tmpqgZNqF/Backup_over_a_full_disk/datadir/L/0/0/0/39: 28: No
space left on device
    ERROR: RCE08AX: I/O error: None: 28: No space left on device

>>> this error is expected


ERROR: Test suite FAILED in 1 scenarios

>>> However I would expect the test _not_ to fail :)


regards,
Damien

[1] http://obnam.org/bugs/test-for-full-filesystem/





--------------020901010203030801020405
Content-Type: text/x-patch;
 name="0001-wip.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0001-wip.patch"

>From 51d12e91ddcc7aafd788bde9e5ccfd11ffb0f9cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Damien=20Courouss=C3=A9?= <damien.courousse@gmail.com>
Date: Sun, 23 Nov 2014 16:22:01 +0100
Subject: [PATCH] wip

---
 yarns/0030-basics.yarn     | 28 ++++++++++++++++++++++++++++
 yarns/9000-implements.yarn | 28 ++++++++++++++++++++++++++++
 yarns/obnam.sh             | 13 +++++++++++++
 3 files changed, 69 insertions(+)

diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index 4bc8439..0711e42 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -313,3 +313,31 @@ setting to a new size, the backup should still work.
     AND user U restores their latest generation in repository R into X
     THEN L, restored to X, matches manifest M
     AND user U can fsck the repository R
+
+Backup over a full disk
+-----------------------
+
+If the backup destination went full, there should be a safe way to access the
+generations that were previously correctly backuped. Obnam commands over this
+backup repository should (at least) return correct error statements.
+
+    SCENARIO Backup over a full disk
+    ASSUMING user has permissions to create and mount disk images
+    GIVEN 100kB of new data in directory L
+    AND a manifest of L in G1
+    AND a volume V of total size 1MB mounted to R
+    WHEN user U backs up directory L to repository R
+    GIVEN 1MB of new data in directory L
+    THEN user U fails the backup of directory L to repository R
+    WHEN user U restores generation 1 to R1 from repository R
+    THEN L, restored to R1, matches manifest G1
+	FINALLY umount R
+
+Points to solve
++ how to test failure for the second backup without aborting with an error?
++ how to create, and later delete, data in repository R?
+
++ testing failure for the second backup
++ autre solution: créer de nouvelles data avant le 2e backup, pour remplir le disque,
+  + puis supprimer les data
+  + obnam devrait fonctionner
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index 1a86fbe..7a9788e 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -619,6 +619,34 @@ often is disabled on build servers.
     touch "$DATADIR/xattr.test"
     setfattr -n user.foo -v bar "$DATADIR/xattr.test"
 
+Check on whether user can create and mount volume images
+--------------------------------------------------------
+
+    IMPLEMENTS ASSUMING user has permissions to create and mount disk images
+    echo "TODO" 1>&2
+    exit 0
+
+    IMPLEMENTS GIVEN a volume (\S+) of total size (\S+) mounted to (\S+)
+    echo "volume name: $DATADIR/$MATCH_1" 1>&2
+    echo "size: $MATCH_2" 1>&2
+    create_disk "$DATADIR/$MATCH_1" "$MATCH_2"
+    mkdir -p "$DATADIR/$MATCH_3"
+    sudo mount -o loop,users,defaults "$DATADIR/$MATCH_1" "$DATADIR/$MATCH_3"
+    sudo chmod 777 "$DATADIR/$MATCH_3"
+
+    IMPLEMENTS WHEN fail here
+    exit 1
+
+	IMPLEMENTS FINALLY umount (\S+)
+    sudo -u root umount "$DATADIR/$MATCH_1"
+
+This backup is expected to fail.
+
+    IMPLEMENTS THEN user (\S+) fails the backup of directory (\S+) to repository (\S+)
+    run_obnam "$MATCH_1" backup -r "$DATADIR/$MATCH_3" "$DATADIR/$MATCH_2"
+	exit 0
+
+
 
 Nagios
 ------
diff --git a/yarns/obnam.sh b/yarns/obnam.sh
index 0792bce..4bca356 100644
--- a/yarns/obnam.sh
+++ b/yarns/obnam.sh
@@ -192,6 +192,19 @@ get_keyid()
 }
 
 
+# Create a disk image
+create_disk()
+{
+    local DISK="$1"
+    local SIZE="$2"
+    local DEV=`sudo losetup -f`
+    dd if=/dev/zero of="$DISK" bs=1 count=0 seek="$SIZE"
+    sudo losetup "$DEV" "$DISK"
+    sudo mkfs.ext3 "$DEV"
+    sudo losetup -d "$DEV"
+}
+
+
 # Create a dummy $HOME that actually exists.
 export HOME="$DATADIR/home"
 mkdir -p "$HOME"
-- 
2.1.0




--------------020901010203030801020405
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
obnam-dev mailing list
obnam-dev@obnam.org
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org

--------------020901010203030801020405--