[5/8] btrfs-progs: tests: Add tests for changing fsid feature
diff mbox series

Message ID 1539270244-27076-6-git-send-email-nborisov@suse.com
State New
Headers show
Series
  • FSID change userspace v2
Related show

Commit Message

Nikolay Borisov Oct. 11, 2018, 3:04 p.m. UTC
Add a bunch of tests exercising the new btrfstune functionality. In
particular check that various restrictions are implemented correctly,
test that btrfs-image works as expected and also test the output of
btrfs inspect-internal dump-super is correct.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 tests/misc-tests/033-metadata-uuid/disk1.raw.xz | Bin 0 -> 78336 bytes
 tests/misc-tests/033-metadata-uuid/disk2.raw.xz | Bin 0 -> 77664 bytes
 tests/misc-tests/033-metadata-uuid/disk3.raw.xz | Bin 0 -> 78328 bytes
 tests/misc-tests/033-metadata-uuid/disk4.raw.xz | Bin 0 -> 77592 bytes
 tests/misc-tests/033-metadata-uuid/disk5.raw.xz | Bin 0 -> 78348 bytes
 tests/misc-tests/033-metadata-uuid/disk6.raw.xz | Bin 0 -> 77552 bytes
 tests/misc-tests/033-metadata-uuid/test.sh      | 225 ++++++++++++++++++++++++
 7 files changed, 225 insertions(+)
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk1.raw.xz
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk2.raw.xz
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk3.raw.xz
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk4.raw.xz
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk5.raw.xz
 create mode 100644 tests/misc-tests/033-metadata-uuid/disk6.raw.xz
 create mode 100755 tests/misc-tests/033-metadata-uuid/test.sh

Patch
diff mbox series

diff --git a/tests/misc-tests/033-metadata-uuid/disk1.raw.xz b/tests/misc-tests/033-metadata-uuid/disk1.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..24f47d2b07553b394f273df8794f503935ab658e
GIT binary patch
literal 78336
zcmeI5i8s{y|Ho&t<!dil(p6cqMI>8pWSE$2S({;!7V6%}2-%k*5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kw6<F2WbVQ
z6_8dyS^;PTXar~kXcR!Kwy76|ai>*w11K02Y<=4&C=3(^3WEtmm_URHM3_K?3B+$S
zX$7_dYz5c~uoYk{z*c~*09ygJ;_o>U1s?`J415^)Fz{jE!@!4u4+9?tK8)js{_G4)
zQNt89Oi{xWHB3>%6m`BAOi{xWHB3>%6!j`oJSZ3xY<*)-P#7o-6b2U?;9`TM-9WMG
zyH$1rIG2Qit#A7Tg@M9AVQ}&dC*N@L4JY4l@(m~7aPkc&-`FbZ#a!ITs3pV3#inl=
ztV15QO1ljOgMzIupMb(ZVW2RGs3D?;h`RjAT`@lV`gQ|ITvxf@K*6A3up}X(hKL#>
zYKW*IqK1eXB5H`JA)<zlsK86XFi;0+MK+)jpb?-Epb?-Epb?-Epb?-Epb?-Epb?-E
zpwSLMBS0fSBS0fSBS0fSBS0fSBS0fSBS0fSBS0euKqEjSKqEjSKqEjSKqEjSKqEjS
zKqEjSKqEk-tAIv;Mu0|uMu0|uMu0|uMu0|uMu0|uMu0|uM*ruB2jQ_Ic&rE>EBfJX
z<oZ!q5NwD^CzD&tRry}5sUNbK5zQnmv#1IDA_CbxOz-FC_X&wWgp?{&ar3Im(jory
IM~}1kH-Kd|J^%m!

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/disk2.raw.xz b/tests/misc-tests/033-metadata-uuid/disk2.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..a1c80371b47080d435010a1de07c4a0c4f67a35b
GIT binary patch
literal 77664
zcmeI*c{tVi9tZFvdmKxWEfU#FLW6W{WlK~?8;+$jMP$obt`jAuP$5NGVr0pZp&_zF
zQzM-up(GR;J0p~xd*|L~?(^JP?o%`A@yFZW9_R5r-{0r+ef_@g-}g7G=C|LHKw#>6
z{=LBx!fJ+<1OkDlcK_q~c{avn)&zpv?EHMn?Ri5jBYqE!1G|c%WV=#ASSN=%#ZJ|)
zf3RsYgGt_r>d;Wr^(n-c0cmf;C3(%?SO`Aw4(;%rD2xu^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FjX)#N
z2s8qXKqJryGy;u4qZ-f%Gy;u4BhUym0*yc;&<HdFjX)#N2s9#tMxYUB1R8-xpb=;U
z8i7Wj5oiP&fkvRwSD+DS1R8-xpb=;U8i7Wj5oiP&fkvPaXp{*WfkvPaXapL8MxYUB
z1R8-xpb=;U8i7V+&<HdFjX)#N2s8qXKqJryGy;u4BhUym5(14tBhUym0*yc;&<HdF
zjX)#N2s8qXK%@Jh5oiP&fkvPaXapL8MxT>Lfjuh;M8bfldHQVmO@F=|`DL7hfBlpS
mZ5-Agt1Kok6tpn~1_n+s5D2xa$ok6#G?f^C`2{8m%YOoASkx{6

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/disk3.raw.xz b/tests/misc-tests/033-metadata-uuid/disk3.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..25e9be696fef1d3ae590185a85de9ed9a2a7d012
GIT binary patch
literal 78328
zcmeI5XH?YblE%BqC`e9%AUOyEl0iU8!T<)^L2?pNl++RgMB>08L4qKlk|ZOk2@)i!
zC|Lo?NRAREh#;YN_spHMvv=>E3p1d8C_j5nAL`Uw_57Zy_x*24xa#O35O@=vg(^4*
zRwNSwfgpdU(}cxx;GHl;AZ)j=*ra0Y897y&n^LA1O2T<2lKcqQ=f{}6-wVE$K8aMv
zxYq{+XbL8g_IRX@2C-A1hIHv)I|hv0T6-4ZL2|u%z(LL2AVH{pP+Fn9W^-a84LcRK
z6?dpaBC&>#4>^nNcQMubx<s+Gx->zLuny6nJbY$gGK@VzCZ~?EnJV$kWc52b=H^qu
zfnt^c4mlR7zQ-9?rppXNTlht3cx32YJ5|bNX8B@Y-JYuFwsk@4exRM#XHhp^n7iEI
zZPrDNcDbQC#y{yEwz*>3QR@_2R7-)Am}&knhQBm*oGtsh23nGLyPi(Ex5dlL>>X1+
zkz^#MD(X2;(RknojDgGuf9Y&a+nnfpm#S0ZDr=&r<|FN#Nc+tY{Ty@mCr<vw4=!ar
z(;T)uV!NU4Pj02q=r3=82x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<M~7&<M~7&<M~7
z&<M~7&<M~7&<M~7(5M;E2+#=72+#=72+#=72+#=72+#=72+#=72+&9i&<M~7&<M~7
z&<M~7&<N1z$3r8}NfiVsV%8p&wpE$qM(Rn#poaMGe^V%%4prW_LI`B@D4wUM=T{^G
V!L^m|K}{zkg!@1L0Z&)&zW~lEG_wEz

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/disk4.raw.xz b/tests/misc-tests/033-metadata-uuid/disk4.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..f591cfec6f3fe93c6a2170cb6f5edc2d8dd3cdff
GIT binary patch
literal 77592
zcmeI5i#L?}8pq!$QAtQQ5?d-09oH^MLuHp}Dvg9hrId1MTuO4k$IdlUbdh^1q``KX
zqjXWCh^UY<iCvo#HDWktoxRstt95o;%EUVB+duHG9^ZMspXYhMzu(JQ>SAO<5Iil9
zuC5+KNRh+|f)KiIbZ=l_{8*uF1YyS+7)Zz+SVPg7X0NtGKQDsZlHkwR)6SCceyDI$
zU4x{T<$fn9h^mkv@Yo}{`4?$nT9fh2n@&M54zY8NdraC_+~~M=m+4uP?h==AYs739
z#AUmAE;5tQ7t@eBt!91iB0WM^>-nuvKdV|*i+7%?qQ`i=N(=26zQud)xY;aQw3oVN
z*PK0kcfD%O4~G?nQElW^v>g+}45t;$bv`NSufNY}%3g=IFu8%L(Z5Mw+L;`B+PS@3
zWLw`1%7uCxooc(O4Khsf<&CQw@-|r7@NTcUd%o<M6}8ei+96E!zO%o7c8~W)ds}VI
zYT5%o?@zg5;a1yCbMDaA`q9nQtjGdJ!d6>FI+?<HNgL0kNSnVQm-$sj#RR#_hIh(1
zeH1O`jiJVH>N0A=1aHivvAe^UD2+?XY`431fVyT<Ww`K#OWSAXS7gb|G&S~bv)p9F
zY&&?-nDuh&xbZ!=pIqwe-6ZE&F0u8el|2o#<?IE!CM@$TleK=vSoZctk-Yf@L5iN`
z$}o}1y%};jt7#u7J}$~`=@|is`gC~2``=PxKBP?`FV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DMgiHkufk7@F9q
zYht*l@jusxV!?y30M5?i>^#oS|LBXG2k*QiL9TyZ42%^bR)|<3j>;7xz!l)ionu;P
z`e^!S`e^z{xeo6qT0r{4zGJ~?G(@XH!B8;ndOH*bg+XD+Q6oo<9QF5q)^KoU#<pUJ
zeuILcVB9rmC=3dN!mvQZ0uc*DeEIlGA6<q^!X@F7a7nl%ToNt`my~lXml%d?qk$E`
z3Sb4W0$2g809F7ifE7yPl5j!%SBB-0-Wei2qF^W(cX1mEgTkON1nLl|L!b_Ux-SiM
za7nl%ToNt`mxN2gCE=38wDts604snMzzSdmumV^CtN>Pw%-d9O7&r_Z1`Y#<fy2OI
z;4p9)ILuW^>}>8aWL&@04R8`<h|G+Fp<vt{GN3Rh3<|^HEF8|l;VghFz;&3$SYQRP
z0$2g809F7ifEB<BV8zI6$H8IXFmM<+3>*dy1BZdbz+vDpL5d#k-r>%NY7q(^B5tE#
zC>VF=6DSM{gTj#0M@}C(edP4NGy%gU;gWDkxFlQ>E(w=}OAgbX7+3+U09F7ifEB<B
zU<I%OSTQoMpTS|^FmM<+3>*dy1BZdbz+vDpTvkMPHfHmef2kYb=*$qA83jYZxI1J(
zVNe(phSO{~&4$x#IL!ud9i}lBSOKg6Rsbu26~GE$1+W5GF*4h6a2PlY90m>phk?Vu
zVc;-u7&r`<6&W$xa9I&GhEtbO6DD|L-UvpSNAS@YjW8NvG{R_v(FmgvMk9<y7>zI*
zVKn-G9gRF&#R&o8jRP%(!@TS&lCBrRCW!o#Z2ym}yaa;O(ZJ*B>G_F75W$Pvs;16Z
OrZ|@P_dgzElYasEi@X&8

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/disk5.raw.xz b/tests/misc-tests/033-metadata-uuid/disk5.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..e9095b78877555a7e2364ebb7bf4237c4796c071
GIT binary patch
literal 78348
zcmeI5c{~;98pn^d?6S*FcE^@A9EP$Cvdc0>#?oX>q!dnyP)JeQs4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B0yoFFi;o)Uv~LqdHA=Ni2y4AD*!9D;;|)Ik_5jp2e1OL0<Z$G
z;$QE?K}#K;*#H6t0V8bs1ciaZKw;433SF+B_i!)lC1Ec~*r%aEVW2Qj*m`vwz!kt1
zz!kt1z!kt%#^bZ!iTk6we!kQsF&u*6X;ly~2pD0#9TWx%1BJo4B%DkB`=0y~NjsRx
zg^664$W>bwb%aTfbm%~Y4#buJ%?40$#gmyKU=T3EZZbe&pfFGv9D=|h2podIAqXx`
z<PTp!2A2ev1eXMt1eXMt1eXMt6!&T1w%y2+b;nLx|DWdv0V@D204o4104o4104o41
z04rq3QnF?}w>ldDhXIEHhXIEHhi!G{g)VA5GcN=T0!CP?0)>IXKw&W00D}!M*ih7%
zP4Fu-VDpWq-$1}1V1zYjP#7o-6bAJ$sE0v449+FtToTSD;arjqrN6;P9-)AUCp|*I
zAYg>WZBQ5}3={@6eW>X}O&@Cdf3~3mmjsstmjsstmjsstmjsvmLS;|D3cw1$3cw1$
z3cw1$3cw1$iofPG6*vqy3^)up3^)up3^)up3^)up?2OFL#DYlZas9Jw0FxkiGBX4W
z0!G+P1}F>^1`31WEEvv$;Vb}G0M{?HjRmX#tN^S4tN^S4tN^S4tN^U|YpUbGVZdR)
zVZdR)VZdR)VZdR)VZdQ<_l{NR#EA^+;SpQ1?U?HBOzev37g`t46pSZsL%<+lgx#Nj
z!a!l5FzC~VK7HuZhd%v3+W~`1f=hx+f=hx+f=hx+f=fa@?60X41BU^J0fzyH{fEQQ
zV`~T+#Po5q2dkxz&M^As-bDQR^Y-U#4$qb1J_OOg5Gfjs{z!yCoaAm3V`5d2Ci(Rj
INUd%D0mmL8ng9R*

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/disk6.raw.xz b/tests/misc-tests/033-metadata-uuid/disk6.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..9926ae494f53cbacd94b8bc61a3440b38f1c0ac0
GIT binary patch
literal 77552
zcmeI5`#0448pmgnTNjrkL<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<vv_Z72*1gTk=W$4(zReeCqd8|dJYa7nl%ToNt`mxN2gB{{VA1XchmfEB<B
zU<I%OSOKg6R!q!kDmV-r1`Y#<fy2OI;4p9)I1C&XqB%SD&Pilk$Lj`o6NF7>M!`@p
z?hYAH7!(GD;pHs6oQ0RO0ImR64vn$E3Sb4W0$2g809F7ifEB=siP?^W!@yzSFmM<+
z3>*dy1BZdbz+t$1$EL77Ak((xy*;nMU<o5@WOx&Yo(qJ6*~D!W3<cxvd;*0*VNe)y
z`pD@cr;nWecoQ&O5-tgsgiFFD;gWDkxFq&r6SF4<hk?VuVc;-u7&r_Z1`Y#<fx~dC
zfOn8Bb86*y-2fR^Hkla(L&3N^WI$n17!-!sIb!FCog;P*aOKb#3#<TE04snMzzSdm
zumV^CteBYXI5-R(1`Y#<fy2OI;4p9)I1C(yTLo~dKrvr}dBW(M>$RtaACo39$~=Kz
zjnN3B5%)(UTAK`EI-$dtl0I6P9U^vZ;XEdxI_$8}kh{!M0<pAVGL1$XA`%D+3wMRh
Pl+f4UA^hVr+1BnaD{80U

literal 0
HcmV?d00001

diff --git a/tests/misc-tests/033-metadata-uuid/test.sh b/tests/misc-tests/033-metadata-uuid/test.sh
new file mode 100755
index 000000000000..0ab432938b97
--- /dev/null
+++ b/tests/misc-tests/033-metadata-uuid/test.sh
@@ -0,0 +1,225 @@ 
+#!/bin/bash
+
+source "$TEST_TOP/common"
+
+check_prereq mkfs.btrfs
+check_prereq btrfs
+check_prereq btrfstune
+check_prereq btrfs-image
+
+setup_root_helper
+
+prepare_test_dev
+
+function read_fsid {
+	local dev="$1"
+	echo $(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
+		dump-super "$dev" | awk '/fsid/ {print $2}' | head -n 1)
+}
+
+function read_metadata_uuid {
+	local dev="$1"
+	echo $(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
+		dump-super "$dev" | awk '/metadata_uuid/ {print $2}')
+}
+
+function check_btrfstune {
+	local fsid
+	echo "Checking btrfstune logic" >> "$RESULTS"
+	#Test with random uuid
+	run_check $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
+
+	#check that specific uuid can set
+	run_check $SUDO_HELPER "$TOP/btrfstune" -M d88c8333-a652-4476-b225-2e9284eb59f1 "$TEST_DEV"
+
+	#test that having seed on already changed device doesn't work 
+	run_mustfail "Managed to set seed on metadata uuid fs" \
+		$SUDO_HELPER "$TOP/btrfstune" -S 1 "$TEST_DEV"
+
+	#test that setting both seed and -m|M is forbidden 
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_mustfail "Succeeded setting seed and changing fs uuid" \
+		$SUDO_HELPER "$TOP/btrfstune" -S 1 -m "$TEST_DEV"
+
+	#test that having -m|-M on seed device is forbidden
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check $SUDO_HELPER "$TOP/btrfstune" -S 1 "$TEST_DEV" 
+	run_mustfail "Succeded changing fsid on a seed device" $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
+
+	#test that using -U|-u on an fs with METADATA_UUID flag is forbidden
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
+	run_mustfail "Succeeded triggering FSID rewrite while METADATA_UUID is active" \
+		$SUDO_HELPER "$TOP/btrfstune" -u  "$TEST_DEV"
+
+}
+
+function check_dump_super_output {
+	local fsid
+	local metadata_uuid
+	local dev_item_match
+	local old_metadata_uuid
+
+	echo "Checking dump-super output" >> "$RESULTS"
+	#Assert that metadata/fsid match on non-changed fs
+	fsid=$(read_fsid "$TEST_DEV")
+	metadata_uuid=$(read_metadata_uuid "$TEST_DEV")
+	[ "$fsid" = "$metadata_uuid" ] || _fail "fsid ("$fsid") doesn't match metadata_uuid ("$metadata_uuid")"
+
+	dev_item_match=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
+		"$TEST_DEV" | awk '/dev_item.fsid/ {print $3}')
+
+	[ $dev_item_match = "[match]" ] || _fail "dev_item.fsid doesn't match on non-metadata uuid fs"
+
+
+	echo "Checking output after fsid change" >> "$RESULTS"
+	#change metadatauuid and ensure everything in the output is still correct 
+	old_metadata_uuid=$metadata_uuid
+	run_check $SUDO_HELPER "$TOP/btrfstune" -M d88c8333-a652-4476-b225-2e9284eb59f1 "$TEST_DEV"
+	fsid=$(read_fsid "$TEST_DEV")
+	metadata_uuid=$(read_metadata_uuid "$TEST_DEV")
+	dev_item_match=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" \
+		inspect-internal dump-super "$TEST_DEV" | awk '/dev_item.fsid/ {print $3}')                         
+		                                                                                
+    [ "$dev_item_match" = "[match]" ] || _fail "dev_item.fsid doesn't match on metadata uuid fs"
+	[ "$fsid" = "d88c8333-a652-4476-b225-2e9284eb59f1" ] || _fail "btrfstune metadata UUID change failed"
+	[ "$old_metadata_uuid" = "$metadata_uuid" ] || _fail "Metadata uuid change unexpectedly"
+
+	echo "Checking for incompat textual representation" >> "$RESULTS"
+	#check for textual output of the new incompat feature
+	run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
+		"$TEST_DEV" | grep -q METADATA_UUID
+	[ $? -eq 0 ] || _fail "Didn't find textual representation of METADATA_UUID feature"
+
+	echo "Checking setting fsid back to original" >> "$RESULTS"
+	#ensure that  setting the fsid back to the original works
+	run_check $SUDO_HELPER "$TOP/btrfstune" -M "$old_metadata_uuid" "$TEST_DEV"
+
+	fsid=$(read_fsid "$TEST_DEV")
+	metadata_uuid=$(read_metadata_uuid "$TEST_DEV")
+
+	[ "$fsid" = "$metadata_uuid" ] || _fail "FSID and METADATA_UUID don't match"
+	run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
+		"$TEST_DEV" | grep -q METADATA_UUID
+	[ $? -eq 1 ] || _fail "METADATA_UUID feature still shown as enabled"
+}
+
+function check_image_restore {
+	local metadata_uuid
+	local fsid
+	local fsid_restored
+	local metadata_uuid_restored
+
+	echo "TESTING btrfs-image restore" >> "$RESULTS"
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
+	fsid=$(read_fsid "$TEST_DEV")
+	metadata_uuid=$(read_metadata_uuid "$TEST_DEV")
+	run_mayfail $SUDO_HELPER "$TOP/btrfs-image" "$TEST_DEV" /tmp/test-img.dump
+	# erase the fs by creating a new one, wipefs is not sufficient as it just 
+	# deletes the fs magic string
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check $SUDO_HELPER "$TOP/btrfs-image" -r /tmp/test-img.dump "$TEST_DEV"
+	fsid_restored=$(read_fsid "$TEST_DEV")
+	metadata_uuid_restored=$(read_metadata_uuid "$TEST_DEV")
+
+	[ "$fsid" = "$fsid_restored" ] || _fail "FSID don't match after restore"
+	[ "$metadata_uuid" = "$metadata_uuid_restored" ] || _fail "metadata uuids don't match after restore"
+}
+
+function check_inprogress_flag {
+
+	# check the flag is indeed cleared
+	run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
+		$1 | grep -q 0x1000000001
+	[ $? -eq 1 ] || _fail "Found BTRFS_SUPER_FLAG_CHANGING_FSID_V2 set for $1"
+
+	run_check_stdout $SUDO_HELPER $TOP/btrfs inspect-internal dump-super \
+		$2 | grep -q 0x1000000001
+	[ $? -eq 1 ] || _fail "Found BTRFS_SUPER_FLAG_CHANGING_FSID_V2 set for $2"
+}
+
+function check_completed {
+
+	# check that metadata uuid is indeed completed
+	run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
+		$1 | grep -q METADATA_UUID
+	[ $? -eq 0 ] || _fail "METADATA_UUID not set on $1"
+
+	run_check_stdout $SUDO_HELPER $TOP/btrfs inspect-internal dump-super \
+		$2 | grep -q METADATA_UUID
+	[ $? -eq 0 ] || _fail "METADATA_UUID not set on $2"
+}
+
+function check_multi_fsid_change {
+	check_inprogress_flag $1 $2
+	check_completed $1 $2
+}
+
+function failure_recovery {
+	local image1
+	local image2
+	local loop1
+	local loop2
+	local devcount
+
+	image1=$(extract_image "$1")
+	image2=$(extract_image "$2")
+	loop1=$(run_check_stdout $SUDO_HELPER losetup --find --show "$image1")
+	loop2=$(run_check_stdout $SUDO_HELPER losetup --find --show "$image2")
+
+	# Mount and unmount, on trans commit all disks should be consistent
+	run_check $SUDO_HELPER mount "$loop1" "$TEST_MNT"
+	run_check $SUDO_HELPER umount "$TEST_MNT"
+
+	# perform any specific check
+	$3 "$loop1" "$loop2"
+
+	# cleanup
+	run_check $SUDO_HELPER losetup -d "$loop1"                                      
+	run_check $SUDO_HELPER losetup -d "$loop2"
+	rm -f "$image1" "$image2"
+}
+
+function reload_btrfs {
+	rmmod btrfs
+	modprobe btrfs
+}
+
+#for full coverage we need btrfs to actually be a module
+modinfo btrfs > /dev/null 2>&1 || _not_run "btrfs must be a module."
+modprobe -r btrfs || _not_run "Require btrfs to be unloadable"
+modprobe btrfs || _not_run "btrfs load failed"
+
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+check_btrfstune
+
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+check_dump_super_output
+
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+check_image_restore
+
+# disk1 is an image which has no metadata uuid flags set and disk2 is part of
+# the same fs but has the in-progress flag set. Test that whicever is scanned
+# first will result in consistent filesystem.
+failure_recovery "./disk1.raw.xz" "./disk2.raw.xz" check_inprogress_flag
+reload_btrfs
+failure_recovery "./disk2.raw.xz" "./disk1.raw.xz" check_inprogress_flag
+
+reload_btrfs
+
+# disk4 contains an image in with the in-progress flag set and disk 3 is part
+# of the same filesystem but has both METADATA_UUID incompat and a new
+# metadata uuid set. So disk 3 must always take precedence. 
+failure_recovery "./disk3.raw.xz" "./disk4.raw.xz" check_completed
+reload_btrfs
+failure_recovery "./disk4.raw.xz" "./disk3.raw.xz" check_completed
+
+# disk5 contains an image which has undergone a successful fsid change more 
+# than once, disk6 on the other hand is member of the same filesystem but 
+# hasn't completed its last change. Thus it has both the FSID_CHANGING flag set
+# and METADATA_UUID flag set. 
+failure_recovery "./disk5.raw.xz" "./disk6.raw.xz" check_multi_fsid_change
+reload_btrfs
+failure_recovery "./disk6.raw.xz" "./disk5.raw.xz" check_multi_fsid_change