summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2020-05-29 16:37:22 +0100
committerPete Batard <pete@akeo.ie>2020-05-30 12:03:07 +0100
commit6fa9723f4d920bc737615998b547b3f2b0f2316e (patch)
tree8e3f7a8177b103ec5172433843c12740d3f81cfe
parentc5baa01cffaf684a8007104b0a812c815449d32e (diff)
downloadlibcdio-6fa9723f4d920bc737615998b547b3f2b0f2316e.tar.gz
Add Rock Ridge deep directory testrr-deep-directory
The test is designed to test more than one level of deep directories. Also the ISO is designed so that the folder with deep directory children (/1/) appears before the target (/rr_moved/), so that any endless recursion during lookup of the CL target will be tested. In other words, this validates that the deep directory lookup doesn't only work if the CL target can be listed before the CL source.
-rw-r--r--test/Makefile.am4
-rwxr-xr-xtest/check_deep_directory.sh59
-rw-r--r--test/data/Makefile.am1
-rw-r--r--test/data/deep-directory.isobin0 -> 397312 bytes
-rw-r--r--test/data/deep_directory1_file1
-rw-r--r--test/data/deep_directory2_file1
-rw-r--r--test/deep_directory.right80
7 files changed, 144 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 7be48a2..d1385ad 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -51,7 +51,7 @@ testpregap_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh check_udf.sh \
check_iso.sh check_bad_iso.sh check_multiextent.sh \
- check_fuzzyiso.sh check_opts.sh \
+ check_fuzzyiso.sh check_opts.sh check_deep_directory.sh \
check_iso_read.sh check_cdtext.sh
check_udf.sh: @abs_top_builddir@/example/extract$(EXEEXT)
@@ -63,7 +63,7 @@ check_PROGRAMS = $(hack)
check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \
videocd.right multiextent.right \
- cdda.right cdda_4_5.right \
+ cdda.right cdda_4_5.right deep_directory.right \
isofs-m1.right isofs-m1-no-rr.right isofs-m1-test2.right \
check_opts0.right check_opts1.right check_opts2.right \
check_opts3.right check_opts4.right check_opts5.right \
diff --git a/test/check_deep_directory.sh b/test/check_deep_directory.sh
new file mode 100755
index 0000000..e72e5e9
--- /dev/null
+++ b/test/check_deep_directory.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright (C) 2020 Pete Batard <pete@akeo.ie>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Tests Rock Ridge deep directories (via iso-info and iso-read).
+
+if test -z "$srcdir" ; then
+ srcdir=`pwd`
+fi
+
+if test "X$top_builddir" = "X" ; then
+ top_builddir=`pwd`/..
+fi
+
+. ${top_builddir}/test/check_common_fn
+
+if test ! -x ../src/iso-info ; then
+ exit 77
+fi
+
+if test ! -x ../src/iso-read ; then
+ exit 77
+fi
+
+BASE=`basename $0 .sh`
+
+fname=deep_directory
+
+# File listing
+iso_image="${srcdir}/data/deep-directory.iso"
+opts="--no-header --quiet -l ${iso_image}"
+test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right
+RC=$?
+check_result $RC 'Deep directory listing test' "$ISO_INFO $opts"
+
+# File dump and comparison
+opts="--ignore --image ${iso_image} --extract 1/2/3/4/5/6/7/8/8.txt"
+test_iso_read "$opts" ${fname} ${srcdir}/data/deep_directory1_file
+RC=$?
+check_result $RC 'Deep directory read test level 8' "$ISO_READ $opts"
+
+opts="--ignore --image ${iso_image} --extract 1/2/3/4/5/6/7/8/9/10/11/12/13/14/14.txt"
+test_iso_read "$opts" ${fname} ${srcdir}/data/deep_directory2_file
+RC=$?
+check_result $RC 'Deep directory read test level 14' "$ISO_READ $opts"
+
+exit $RC
diff --git a/test/data/Makefile.am b/test/data/Makefile.am
index 1c870cf..578426c 100644
--- a/test/data/Makefile.am
+++ b/test/data/Makefile.am
@@ -23,6 +23,7 @@ check_DATA = \
copying.iso \
data1.toc \
data2.toc \
+ deep-directory.iso \
isofs-m1.bin \
isofs-m1.cue \
isofs-m1.toc \
diff --git a/test/data/deep-directory.iso b/test/data/deep-directory.iso
new file mode 100644
index 0000000..ea5b911
--- /dev/null
+++ b/test/data/deep-directory.iso
Binary files differ
diff --git a/test/data/deep_directory1_file b/test/data/deep_directory1_file
new file mode 100644
index 0000000..e5a2601
--- /dev/null
+++ b/test/data/deep_directory1_file
@@ -0,0 +1 @@
+level 8 \ No newline at end of file
diff --git a/test/data/deep_directory2_file b/test/data/deep_directory2_file
new file mode 100644
index 0000000..de4709f
--- /dev/null
+++ b/test/data/deep_directory2_file
@@ -0,0 +1 @@
+level 14 \ No newline at end of file
diff --git a/test/deep_directory.right b/test/deep_directory.right
new file mode 100644
index 0000000..6e3ffa8
--- /dev/null
+++ b/test/deep_directory.right
@@ -0,0 +1,80 @@
+__________________________________
+ISO-9660 Information
+/:
+ dr-xr-xr-x 3 0 0 [LSN 23] 2048 May 29 2020 15:32:43 .
+ dr-xr-xr-x 3 0 0 [LSN 23] 2048 May 29 2020 15:32:43 ..
+ dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 1
+
+/1/:
+ dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 .
+ dr-xr-xr-x 4 0 0 [LSN 23] 2048 May 29 2020 15:32:43 ..
+ dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 2
+
+/1/2/:
+ dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 .
+ dr-xr-xr-x 3 0 0 [LSN 32] 2048 May 28 2020 16:14:19 ..
+ dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 3
+
+/1/2/3/:
+ dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 .
+ dr-xr-xr-x 3 0 0 [LSN 33] 2048 May 28 2020 16:14:21 ..
+ dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 4
+
+/1/2/3/4/:
+ dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 .
+ dr-xr-xr-x 3 0 0 [LSN 34] 2048 Apr 29 2020 22:35:20 ..
+ dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 5
+
+/1/2/3/4/5/:
+ dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 .
+ dr-xr-xr-x 3 0 0 [LSN 35] 2048 Apr 29 2020 22:35:24 ..
+ dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 6
+
+/1/2/3/4/5/6/:
+ dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 .
+ dr-xr-xr-x 3 0 0 [LSN 36] 2048 Apr 29 2020 22:35:27 ..
+ dr-xr-xr-x 3 0 0 [LSN 38] 2048 May 28 2020 17:16:58 7
+
+/1/2/3/4/5/6/7/:
+ dr-xr-xr-x 3 0 0 [LSN 38] 2048 May 28 2020 17:16:58 .
+ dr-xr-xr-x 3 0 0 [LSN 37] 2048 May 28 2020 16:16:34 ..
+ -r-xr-xr-x 1 0 0 [LSN 43] 7 May 28 2020 16:15:56 7.txt
+ dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 8
+
+/1/2/3/4/5/6/7/8/:
+ dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 .
+ dr-xr-xr-x 4 0 0 [LSN 24] 2048 May 28 2020 17:16:58 ..
+ -r-xr-xr-x 1 0 0 [LSN 40] 7 May 28 2020 16:16:15 8.txt
+ dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 9
+
+/1/2/3/4/5/6/7/8/9/:
+ dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 .
+ dr-xr-xr-x 3 0 0 [LSN 25] 2048 May 28 2020 16:16:05 ..
+ dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 10
+
+/1/2/3/4/5/6/7/8/9/10/:
+ dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 .
+ dr-xr-xr-x 3 0 0 [LSN 26] 2048 May 28 2020 16:13:50 ..
+ dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 11
+
+/1/2/3/4/5/6/7/8/9/10/11/:
+ dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 .
+ dr-xr-xr-x 3 0 0 [LSN 27] 2048 May 28 2020 16:14:27 ..
+ dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 12
+
+/1/2/3/4/5/6/7/8/9/10/11/12/:
+ dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 .
+ dr-xr-xr-x 3 0 0 [LSN 28] 2048 May 28 2020 16:14:32 ..
+ dr-xr-xr-x 3 0 0 [LSN 30] 2048 May 28 2020 17:17:00 13
+
+/1/2/3/4/5/6/7/8/9/10/11/12/13/:
+ dr-xr-xr-x 3 0 0 [LSN 30] 2048 May 28 2020 17:17:00 .
+ dr-xr-xr-x 3 0 0 [LSN 29] 2048 May 28 2020 16:14:37 ..
+ -r-xr-xr-x 1 0 0 [LSN 41] 8 May 28 2020 16:45:15 13.txt
+ dr-xr-xr-x 2 0 0 [LSN 31] 2048 May 28 2020 16:46:40 14
+
+/1/2/3/4/5/6/7/8/9/10/11/12/13/14/:
+ dr-xr-xr-x 2 0 0 [LSN 31] 2048 May 28 2020 16:46:40 .
+ dr-xr-xr-x 4 0 0 [LSN 24] 2048 May 28 2020 17:17:00 ..
+ -r-xr-xr-x 1 0 0 [LSN 42] 8 May 28 2020 16:17:21 14.txt
+