[v2,3/3] btrfs-progs: fsck-tests: add test case to check symlinks with bad flags
diff mbox

Message ID 20180515013324.18838-4-suy.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Su Yue May 15, 2018, 1:33 a.m. UTC
There are two bad symlinks in the test case.
One is with immutable attribute.
Another one is with append attribute.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
---
 .../034-bad-inode-flags/default_case.img         | Bin 0 -> 4096 bytes
 tests/fsck-tests/034-bad-inode-flags/test.sh     |  15 +++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 tests/fsck-tests/034-bad-inode-flags/default_case.img
 create mode 100755 tests/fsck-tests/034-bad-inode-flags/test.sh

Patch
diff mbox

diff --git a/tests/fsck-tests/034-bad-inode-flags/default_case.img b/tests/fsck-tests/034-bad-inode-flags/default_case.img
new file mode 100644
index 0000000000000000000000000000000000000000..43a2a6f62d5ef3afd77f117b577a56ad6098ed19
GIT binary patch
literal 4096
zcmeH}c{CJUAIFU?k*yI4S@RGnly%15rj(_~G8rO6vS$b*hR9G^M_GnP*~gG%*XULD
zecwiA3?YW>hM5=dd(Ly-=e+&-p7Z|Uo_l`xdw=)dbMEhRes@7VO!Ok2v8iSFcVXRY
z0S9$YY#lgx4lMhgmx00fKp$b;YjjKwbl1Mc|4Xm#`|-vHGaC;^56vNgLjwQD1pG!)
z0%s{UtRTF}`3%o*f~o}Ub~i7&5a;#~3S~wq>yb%mpwOOBQV@&XDK2I`K}NNkK2T)W
zP3ZBKkdz|>(+ppAd?n&e`Mhq5Y_Mx6#)lkr%V0RYfv<lo6x+fvt02ztkuYp%%Q;xT
zy4}PY3R{h2>XKS#j!hDNZK|Zl0`#(aZhs{~>g=;i^@`D<CKuSR)XSV?$%1x;Facnk
z)_??Qc_w|aw;%(sc8y(>f+(}JrN_k>!De44F)K~Z_B2ji*e|B3TM=T#=3J?hFQkLT
zcoHc*_{i*Zl|=_O)<@(9atD)c?k`SQU{$3zUo_)!00YeaVw>N{!sut0FUEY0%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PHIJE#sScog}q#^ZcNjkkDWT0}Nqt
zFXuZ-H~@Ah8<%Hn^c0iZ%hSJRE1;Ex$fh(N+4l)MfFwEOWtF%@T~=vDOV<PkekL!A
ztK!oXCx6Vu3Wzdl{TODlh3_j(oCW~}8?a*%m2<5!1!L5f2Zaf9CGC!AH#pEYvq#nn
zFmu02{qC|`H7=bqHYo?_i^}rkmN0v4k5<iF_OGA_&X0I~s^tv*%{7XL)6hSG5Q~X(
kIq6x%Jnm_FaB;gC4ZY2N*-{?-H$sQqLjs2c{x<~v38kbqN&o-=

literal 0
HcmV?d00001

diff --git a/tests/fsck-tests/034-bad-inode-flags/test.sh b/tests/fsck-tests/034-bad-inode-flags/test.sh
new file mode 100755
index 000000000000..2225efb44e0e
--- /dev/null
+++ b/tests/fsck-tests/034-bad-inode-flags/test.sh
@@ -0,0 +1,15 @@ 
+#!/bin/bash
+# In order to confirm that 'btrfs check' supports checking symlinks
+# with immutable/append attributes.
+#
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+
+check_image() {
+	run_mustfail "check should report errors about inode flags" \
+        $SUDO_HELPER "$TOP/btrfs" check "$1"
+}
+
+check_all_images