diff --git a/tests/misc-tests/042-ino-cache-clean/ino-cache-enabled.raw.xz b/tests/misc-tests/042-ino-cache-clean/ino-cache-enabled.raw.xz
new file mode 100644
index 0000000000000000000000000000000000000000..721c9521441e3adf3769b1a2ed61fa0e78ba63f8
GIT binary patch
diff --git a/tests/misc-tests/042-ino-cache-clean/test.sh b/tests/misc-tests/042-ino-cache-clean/test.sh
new file mode 100755
index 000000000000..cb977b8267c6
--- /dev/null
+++ b/tests/misc-tests/042-ino-cache-clean/test.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Ensure that clearning ino cache works as expected
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+
+setup_root_helper
+
+image=$(extract_image "./ino-cache-enabled.raw.xz")
+
+run_check $SUDO_HELPER "$TOP/btrfs" check --clear-ino-cache "$image"
+run_check $SUDO_HELPER "$TOP/btrfs" check "$image"
+
+# check for FREE_INO items for main subvol
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t5 \
+	"$image" | grep -c 'item [0-9].* key (FREE_INO')
+[ $item_count -eq 0 ] || _fail "FREE_INO items for main vol present"
+# check for bitmap item for main subvol
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t5 \
+	"$image" | grep -c '(FREE_SPACE')
+[ $item_count -eq 0 ] || _fail "FREE_SPACE items for main vol present"
+
+# check for FREE_INO items for snapshot
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t256 \
+	"$image" | grep -c 'item [0-9].* key (FREE_INO')
+[ $item_count -eq 0 ] || _fail "ino cache items for subvol present"
+# check for bitmap item for subvol
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t256 \
+	"$image" | grep -c '(FREE_SPACE')
+[ $item_count -eq 0 ] || _fail "FREE_SPACE items for subvol present"
+
+# check for FREE_INO items for snapshot
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t257  \
+	"$image" | grep -c 'item [0-9].* key (FREE_INO')
+[ $item_count -eq 0 ] || _fail "ino cache items for snapshot present"
+# check for bitmap item for snapshot
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t257 \
+	"$image" | grep -c '(FREE_SPACE')
+[ $item_count -eq 0 ] || _fail "FREE_SPACE items for snapshot present"
+
+# Finally test that the csum tree is empty as ino cache also uses it. At this
+# point all ino items/extents should have been deleted hence the csum tree should
+# be empty
+item_count=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
+	dump-tree -t7 "$image" | sed  -n -e 's/^.* items \([0-9]*\).*/\1/p')
+
+[ $item_count -eq 0 ] || _fail "csum tree not empty"
+
+rm -f "$image"
+
