diff --git a/tests/fsck-tests/020-extent-ref-cases/keyed_block_ref.img b/tests/fsck-tests/020-extent-ref-cases/keyed_block_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..289d37bc309fb8c33bff13cb71de8b9c5d83f1bb
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/keyed_data_ref.img b/tests/fsck-tests/020-extent-ref-cases/keyed_data_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..2ac0ae5361b5d7fb66de6f9844d3456e2e998c01
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/no_inline_ref.img b/tests/fsck-tests/020-extent-ref-cases/no_inline_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..b05ae73f30edf058d2e1de700b6a1639fe4facd1
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/no_skinny_ref.img b/tests/fsck-tests/020-extent-ref-cases/no_skinny_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..900b65caa180e7305999b485008030901a879cac
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/shared_block_ref.img b/tests/fsck-tests/020-extent-ref-cases/shared_block_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..8d7b50f7f1e8be1013759e6f770c89beee616011
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/shared_data_ref.img b/tests/fsck-tests/020-extent-ref-cases/shared_data_ref.img
new file mode 100644
index 0000000000000000000000000000000000000000..aa2dafa5d593dfd1a20c7e1f2d008eb53964d508
GIT binary patch
diff --git a/tests/fsck-tests/020-extent-ref-cases/test.sh b/tests/fsck-tests/020-extent-ref-cases/test.sh
new file mode 100755
index 0000000..9b23319
--- /dev/null
+++ b/tests/fsck-tests/020-extent-ref-cases/test.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+source $TOP/tests/common
+
+check_prereq btrfs
+
+for img in *.img
+do
+	image=$(extract_image $img)
+	run_check_stdout $TOP/btrfs check "$image" 2>&1 |
+		grep -q "Errors found in extent allocation tree or chunk allocation" &&
+		_fail "unexpected error occurred when checking $img"
+	rm -f "$image"
+done
