summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-04-21 23:54:22 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-04-21 23:54:22 (GMT)
commit375dda3d58f49ef52148aa41aa6d5d6332528874 (patch)
treee370cbc618328471d15c0f2b84479cdda736c2a2 /tools
parentb120aff5cf29a9ab0d01594db44ee1f592f08c9e (diff)
downloadhdf5-375dda3d58f49ef52148aa41aa6d5d6332528874.zip
hdf5-375dda3d58f49ef52148aa41aa6d5d6332528874.tar.gz
hdf5-375dda3d58f49ef52148aa41aa6d5d6332528874.tar.bz2
[svn-r20595] Purpose:
HDFFV-5948 - CHICAGO: Tools - implement missing external link test cases Description: Add three test cases for h5dump and h5ls. - h5ls: external link to soft link with follow symlink. - h5dump: external link to soft link with follow symlink. - h5ls: external link to soft link without follow symlink. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/CMakeLists.txt1
-rw-r--r--tools/h5dump/h5dumpgentest.c5
-rw-r--r--tools/testfiles/textlinkfar.ddl18
-rw-r--r--tools/testfiles/textlinksrc-1-old.ls4
-rw-r--r--tools/testfiles/textlinksrc-1.ls4
-rw-r--r--tools/testfiles/textlinksrc-3-old.ls2
-rw-r--r--tools/testfiles/textlinksrc-3.ls2
-rw-r--r--tools/testfiles/textlinksrc-4.ls2
-rw-r--r--tools/testfiles/textlinksrc-6-old.ls2
-rw-r--r--tools/testfiles/textlinksrc-6.ls2
-rw-r--r--tools/testfiles/textlinksrc-nodangle-2.ls2
-rw-r--r--tools/testfiles/textlinksrc.ddl18
-rw-r--r--tools/testfiles/textlinksrc.h5bin1104 -> 1224 bytes
13 files changed, 62 insertions, 0 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 30b40da..258d344 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -251,6 +251,7 @@ IF (BUILD_TESTING)
tdatareg.h5
tdset.h5
tempty.h5
+ textlinksrc.h5
textlinkfar.h5
textlinksrc.h5
textlinktar.h5
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index d2af91c..0fe9b69 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -6896,6 +6896,11 @@ gent_extlinks(void)
H5Lcreate_external(FILE62, "type", source_fid, "ext_link3", H5P_DEFAULT, H5P_DEFAULT);
H5Lcreate_external(FILE62, "group/elink_t2", source_fid, "ext_link4", H5P_DEFAULT, H5P_DEFAULT);
H5Lcreate_external(FILE62, "empty_group", source_fid, "ext_link5", H5P_DEFAULT, H5P_DEFAULT);
+/* external link to soft link which linked to a dataset */
+ H5Lcreate_external(FILE4_1, "/soft_dset1", source_fid, "ext2soft_link1", H5P_DEFAULT, H5P_DEFAULT);
+
+/* external link to dangle soft link */
+ H5Lcreate_external(FILE4_1, "/soft_dangle", source_fid, "ext2softdangle_link1", H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
* create external link in the "far" file pointing to the source file
diff --git a/tools/testfiles/textlinkfar.ddl b/tools/testfiles/textlinkfar.ddl
index 4151710..e2bbf92 100644
--- a/tools/testfiles/textlinkfar.ddl
+++ b/tools/testfiles/textlinkfar.ddl
@@ -7,6 +7,24 @@ GROUP "/" {
TARGETFILE "textlinksrc.h5"
TARGETPATH "/"
GROUP "/" {
+ EXTERNAL_LINK "ext2soft_link1" {
+ TARGETFILE "tsoftlinks.h5"
+ TARGETPATH "/soft_dset1"
+ DATASET "/soft_dset1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) }
+ DATA {
+ (0,0): 0, 0,
+ (1,0): 1, 1,
+ (2,0): 2, 2,
+ (3,0): 3, 3
+ }
+ }
+ }
+ EXTERNAL_LINK "ext2softdangle_link1" {
+ TARGETFILE "tsoftlinks.h5"
+ TARGETPATH "/soft_dangle"
+ }
EXTERNAL_LINK "ext_link1" {
TARGETFILE "textlinktar.h5"
TARGETPATH "group"
diff --git a/tools/testfiles/textlinksrc-1-old.ls b/tools/testfiles/textlinksrc-1-old.ls
index 5e81dec..488c9cf 100644
--- a/tools/testfiles/textlinksrc-1-old.ls
+++ b/tools/testfiles/textlinksrc-1-old.ls
@@ -2,9 +2,13 @@
output for 'h5ls -w80 -Er textlinksrc.h5'
#############################
/ Group
+/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
/ext_link1 External Link {textlinktar.h5//group} {Group}
/ext_link1/dset Dataset {6}
/ext_link1/elink_t1 External Link {textlinksrc.h5//} {Group}
+/ext_link1/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Already Visited}
+/ext_link1/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {Already Visited}
/ext_link1/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited}
/ext_link1/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
/ext_link1/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-1.ls b/tools/testfiles/textlinksrc-1.ls
index f39eec9..8d946d7 100644
--- a/tools/testfiles/textlinksrc-1.ls
+++ b/tools/testfiles/textlinksrc-1.ls
@@ -2,9 +2,13 @@
output for 'h5ls -w80 --follow-symlinks -r textlinksrc.h5'
#############################
/ Group
+/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
/ext_link1 External Link {textlinktar.h5//group} {Group}
/ext_link1/dset Dataset {6}
/ext_link1/elink_t1 External Link {textlinksrc.h5//} {Group}
+/ext_link1/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Already Visited}
+/ext_link1/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {Already Visited}
/ext_link1/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited}
/ext_link1/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
/ext_link1/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-3-old.ls b/tools/testfiles/textlinksrc-3-old.ls
index a86ca32..c10cc1d 100644
--- a/tools/testfiles/textlinksrc-3-old.ls
+++ b/tools/testfiles/textlinksrc-3-old.ls
@@ -4,6 +4,8 @@
ext_link1 External Link {textlinktar.h5//group} {Group}
/dset Dataset {6}
/elink_t1 External Link {textlinksrc.h5//} {Group}
+/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited}
/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-3.ls b/tools/testfiles/textlinksrc-3.ls
index bd173f3..fc3c6a2 100644
--- a/tools/testfiles/textlinksrc-3.ls
+++ b/tools/testfiles/textlinksrc-3.ls
@@ -4,6 +4,8 @@
ext_link1 External Link {textlinktar.h5//group} {Group}
/dset Dataset {6}
/elink_t1 External Link {textlinksrc.h5//} {Group}
+/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited}
/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-4.ls b/tools/testfiles/textlinksrc-4.ls
index f440d9c..4e9414e 100644
--- a/tools/testfiles/textlinksrc-4.ls
+++ b/tools/testfiles/textlinksrc-4.ls
@@ -2,6 +2,8 @@
output for 'h5ls -w80 -r textlinksrc.h5'
#############################
/ Group
+/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1}
+/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle}
/ext_link1 External Link {textlinktar.h5//group}
/ext_link2 External Link {textlinktar.h5//dset}
/ext_link3 External Link {textlinktar.h5//type}
diff --git a/tools/testfiles/textlinksrc-6-old.ls b/tools/testfiles/textlinksrc-6-old.ls
index e1b8b74..578e78e 100644
--- a/tools/testfiles/textlinksrc-6-old.ls
+++ b/tools/testfiles/textlinksrc-6-old.ls
@@ -1,6 +1,8 @@
#############################
output for 'h5ls -w80 -E textlinksrc.h5'
#############################
+ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
ext_link1 External Link {textlinktar.h5//group} {Group}
ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-6.ls b/tools/testfiles/textlinksrc-6.ls
index 6cda888..b8ea95e 100644
--- a/tools/testfiles/textlinksrc-6.ls
+++ b/tools/testfiles/textlinksrc-6.ls
@@ -1,6 +1,8 @@
#############################
output for 'h5ls -w80 --follow-symlinks textlinksrc.h5'
#############################
+ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
ext_link1 External Link {textlinktar.h5//group} {Group}
ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc-nodangle-2.ls b/tools/testfiles/textlinksrc-nodangle-2.ls
index 4713849..e483dd1 100644
--- a/tools/testfiles/textlinksrc-nodangle-2.ls
+++ b/tools/testfiles/textlinksrc-nodangle-2.ls
@@ -1,6 +1,8 @@
#############################
output for 'h5ls -w80 --follow-symlinks --no-dangling-links textlinksrc.h5'
#############################
+ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}}
+ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**}
ext_link1 External Link {textlinktar.h5//group} {Group}
ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}}
ext_link3 External Link {textlinktar.h5//type} {Type}
diff --git a/tools/testfiles/textlinksrc.ddl b/tools/testfiles/textlinksrc.ddl
index b806c56..d41bb6d 100644
--- a/tools/testfiles/textlinksrc.ddl
+++ b/tools/testfiles/textlinksrc.ddl
@@ -3,6 +3,24 @@ Expected output for 'h5dump textlinksrc.h5'
#############################
HDF5 "textlinksrc.h5" {
GROUP "/" {
+ EXTERNAL_LINK "ext2soft_link1" {
+ TARGETFILE "tsoftlinks.h5"
+ TARGETPATH "/soft_dset1"
+ DATASET "/soft_dset1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) }
+ DATA {
+ (0,0): 0, 0,
+ (1,0): 1, 1,
+ (2,0): 2, 2,
+ (3,0): 3, 3
+ }
+ }
+ }
+ EXTERNAL_LINK "ext2softdangle_link1" {
+ TARGETFILE "tsoftlinks.h5"
+ TARGETPATH "/soft_dangle"
+ }
EXTERNAL_LINK "ext_link1" {
TARGETFILE "textlinktar.h5"
TARGETPATH "group"
diff --git a/tools/testfiles/textlinksrc.h5 b/tools/testfiles/textlinksrc.h5
index 062acbe..4db1cc4 100644
--- a/tools/testfiles/textlinksrc.h5
+++ b/tools/testfiles/textlinksrc.h5
Binary files differ