summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-04-22 22:23:45 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-04-22 22:23:45 (GMT)
commitd0495e29cc732b98a7408ae2f05e65e4deb0f9fe (patch)
tree10638324b6b504d700ea19f062025534e6ed9c42
parent8116ae4f78b450609fc53e4e28e9ab9b7da9f5e4 (diff)
downloadhdf5-d0495e29cc732b98a7408ae2f05e65e4deb0f9fe.zip
hdf5-d0495e29cc732b98a7408ae2f05e65e4deb0f9fe.tar.gz
hdf5-d0495e29cc732b98a7408ae2f05e65e4deb0f9fe.tar.bz2
[svn-r20616] Purpose:
HDFFV-5948 - CHICAGO: Tools - implement missing external link test cases Description: Merged from HDF5 trunk r20595 and r20600. 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), cmake
-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 2010b5c..a02388a 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -251,6 +251,7 @@ IF (BUILD_TESTING)
tdatareg.h5
tdset.h5
tempty.h5
+ tsoftlinks.h5
textlinkfar.h5
textlinksrc.h5
textlinktar.h5
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 452441a..ab67db8 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -6887,6 +6887,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