@@ -19,13 +19,14 @@ class TestCreate(TestZstash):
1919 """
2020
2121 # x = on, no mark = off, b = both on and off tested
22- # option | CreateVerbose | CreateIncludeDir | CreateIncludeFile | CreateExcludeDir | CreateExcludeFile | CreateKeep | CreateCache | TestZstash.create (used in multiple tests) | TestCheckParallel.testKeepTarsWithPreviouslySetHPSS |
23- # --exclude | | | |x|x| | | | |
24- # --include | |x|x| | | | | | |
25- # --maxsize | | | | | | | | |x|
26- # --keep | | | | | |x| |b| |
27- # --cache | | | | | | |x| | |
28- # -v |x| | | | | | | | |
22+ # option | CreateVerbose | CreateIncludeDir | CreateIncludeFile | CreateExcludeDir | CreateExcludeFile | CreateKeep | CreateCache | CreateFollowSymlinks | TestZstash.create (used in multiple tests) | TestCheckParallel.testKeepTarsWithPreviouslySetHPSS |
23+ # --exclude | | | |x|x| | | | | |
24+ # --follow-symlinks | | | | | | | |x| | |
25+ # --include | |x|x| | | | | | | |
26+ # --maxsize | | | | | | | | | |x|
27+ # --keep | | | | | |x| | |b| |
28+ # --cache | | | | | | |x|x| | |
29+ # -v |x| | | | | | | | | |
2930
3031 def helperCreateVerbose (self , test_name , hpss_path : str , zstash_path = ZSTASH_PATH ):
3132 """
@@ -209,6 +210,17 @@ def helperCreateCache(self, test_name, hpss_path, zstash_path=ZSTASH_PATH):
209210 )
210211 self .stop (error_message )
211212
213+ def helperCreateFollowSymlinks (self , test_name , zstash_path = ZSTASH_PATH ):
214+ """
215+ Test `zstash create --hpss=none --follow-symlinks --cache=my_cache`
216+ """
217+ self .hpss_path = "none"
218+ self .cache = "my_cache"
219+ use_hpss = self .setupDirs (test_name , follow_symlinks = True )
220+ self .create (use_hpss , zstash_path , follow_symlinks = True , cache = self .cache )
221+ # Test that the link in the src directory remains a link (i.e., is not a copied file)
222+ self .assertTrue (os .path .islink (f"{ self .test_dir } /file0_soft.txt" ))
223+
212224 def testCreateVerbose (self ):
213225 self .helperCreateVerbose ("testCreateVerbose" , "none" )
214226
@@ -252,6 +264,9 @@ def testCreateCacheHPSS(self):
252264 self .conditional_hpss_skip ()
253265 self .helperCreateCache ("testCreateCacheHPSS" , HPSS_ARCHIVE )
254266
267+ def testCreateFollowSymlinks (self ):
268+ self .helperCreateFollowSymlinks ("testCreateFollowSymlinks" )
269+
255270
256271if __name__ == "__main__" :
257272 unittest .main ()
0 commit comments