@@ -625,7 +625,7 @@ func TestArtifactoryCopyExcludeByCli(t *testing.T) {
625
625
artifactoryCli .Exec ("upload" , "--spec=" + specFileB )
626
626
627
627
// Copy by pattern
628
- artifactoryCli .Exec ("cp" , tests .RtRepo1 + "/data/ " + tests .RtRepo2 + "/" , "--exclude-patterns=*b*;*c*" )
628
+ artifactoryCli .Exec ("cp" , tests .RtRepo1 + "/data/" , tests .RtRepo2 + "/" , "--exclude-patterns=*b*;*c*" )
629
629
630
630
// Validate files are moved by build number
631
631
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -1480,14 +1480,14 @@ func TestValidateValidSymlink(t *testing.T) {
1480
1480
assert .NoError (t , err )
1481
1481
1482
1482
// Upload symlink to artifactory
1483
- artifactoryCli .Exec ("u" , validLink + " " + tests .RtRepo1 + " --symlinks=true" )
1483
+ artifactoryCli .Exec ("u" , validLink , tests .RtRepo1 , " --symlinks=true" )
1484
1484
1485
1485
// Delete the local symlink
1486
1486
err = os .Remove (validLink )
1487
1487
assert .NoError (t , err )
1488
1488
1489
1489
// Download symlink from artifactory
1490
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/ --validate-symlinks=true" )
1490
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" , " --validate-symlinks=true" )
1491
1491
1492
1492
// Should be valid if successful
1493
1493
validateSymLink (validLink , localFile , t )
@@ -1569,10 +1569,10 @@ func TestSymlinkWildcardPathHandling(t *testing.T) {
1569
1569
err := os .Symlink (localFile , link )
1570
1570
assert .NoError (t , err )
1571
1571
link1 := filepath .Join (tests .GetTestResourcesPath ()+ "a/" , "link*" )
1572
- artifactoryCli .Exec ("u" , link1 + " " + tests .RtRepo1 + " --symlinks=true" )
1572
+ artifactoryCli .Exec ("u" , link1 , tests .RtRepo1 , " --symlinks=true" )
1573
1573
err = os .Remove (link )
1574
1574
assert .NoError (t , err )
1575
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/ --validate-symlinks=true" )
1575
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" , " --validate-symlinks=true" )
1576
1576
validateSymLink (link , localFile , t )
1577
1577
os .Remove (link )
1578
1578
cleanArtifactoryTest ()
@@ -1589,10 +1589,10 @@ func TestSymlinkToDirHandling(t *testing.T) {
1589
1589
link := filepath .Join (tests .GetTestResourcesPath ()+ "a/" , "link" )
1590
1590
err := os .Symlink (localFile , link )
1591
1591
assert .NoError (t , err )
1592
- artifactoryCli .Exec ("u" , link + " " + tests .RtRepo1 + " --symlinks=true --recursive=true" )
1592
+ artifactoryCli .Exec ("u" , link , tests .RtRepo1 , " --symlinks=true" , " --recursive=true" )
1593
1593
err = os .Remove (link )
1594
1594
assert .NoError (t , err )
1595
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/" )
1595
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" )
1596
1596
validateSymLink (link , localFile , t )
1597
1597
os .Remove (link )
1598
1598
cleanArtifactoryTest ()
@@ -1610,10 +1610,10 @@ func TestSymlinkToDirWildcardHandling(t *testing.T) {
1610
1610
err := os .Symlink (localFile , link )
1611
1611
assert .NoError (t , err )
1612
1612
link1 := filepath .Join (tests .GetTestResourcesPath ()+ "a/" , "lin*" )
1613
- artifactoryCli .Exec ("u" , link1 + " " + tests .RtRepo1 + " --symlinks=true --recursive=true" )
1613
+ artifactoryCli .Exec ("u" , link1 , tests .RtRepo1 , " --symlinks=true" , " --recursive=true" )
1614
1614
err = os .Remove (link )
1615
1615
assert .NoError (t , err )
1616
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/" )
1616
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" )
1617
1617
validateSymLink (link , localFile , t )
1618
1618
os .Remove (link )
1619
1619
cleanArtifactoryTest ()
@@ -1636,14 +1636,14 @@ func TestSymlinkInsideSymlinkDirWithRecursionIssueUpload(t *testing.T) {
1636
1636
err = os .Symlink (localFilePath , link2 )
1637
1637
assert .NoError (t , err )
1638
1638
1639
- artifactoryCli .Exec ("u" , localDirPath + "/link* " + tests .RtRepo1 + " --symlinks=true --recursive=true" )
1639
+ artifactoryCli .Exec ("u" , localDirPath + "/link*" , tests .RtRepo1 , " --symlinks=true" , " --recursive=true" )
1640
1640
err = os .Remove (link1 )
1641
1641
assert .NoError (t , err )
1642
1642
1643
1643
err = os .Remove (link2 )
1644
1644
assert .NoError (t , err )
1645
1645
1646
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link* " + tests .GetTestResourcesPath ()+ "a/" )
1646
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link*" , tests .GetTestResourcesPath ()+ "a/" )
1647
1647
validateSymLink (link1 , localDirPath , t )
1648
1648
os .Remove (link1 )
1649
1649
validateSymLink (link2 , localFilePath , t )
@@ -2245,7 +2245,7 @@ func TestArtifactoryChecksumDownloadRenameFileName(t *testing.T) {
2245
2245
}
2246
2246
2247
2247
func testChecksumDownload (t * testing.T , outFileName string ) {
2248
- artifactoryCli .Exec ("download " + tests .RtRepo1 + "/a1.in" , tests .Out + outFileName )
2248
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/a1.in" , tests .Out + outFileName )
2249
2249
2250
2250
exists , err := fileutils .IsFileExists (tests .Out + outFileName , false )
2251
2251
assert .NoError (t , err )
@@ -2254,7 +2254,7 @@ func testChecksumDownload(t *testing.T, outFileName string) {
2254
2254
firstFileInfo , _ := os .Stat (tests .Out + outFileName )
2255
2255
firstDownloadTime := firstFileInfo .ModTime ()
2256
2256
2257
- artifactoryCli .Exec ("download " + tests .RtRepo1 + "/a1.in" , tests .Out + outFileName )
2257
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/a1.in" , tests .Out + outFileName )
2258
2258
secondFileInfo , _ := os .Stat (tests .Out + outFileName )
2259
2259
secondDownloadTime := secondFileInfo .ModTime ()
2260
2260
@@ -2471,8 +2471,8 @@ func TestArtifactoryDownloadByBuildUsingSimpleDownload(t *testing.T) {
2471
2471
artifactoryCli .Exec ("build-publish" , tests .RtBuildName1 , buildNumberB )
2472
2472
2473
2473
// Download by build number, a1 should not be downloaded, b1 should
2474
- artifactoryCli .Exec ("download " + tests .RtRepo1 + "/data/a1.in " + filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 )
2475
- artifactoryCli .Exec ("download " + tests .RtRepo1 + "/data/b1.in " + filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 )
2474
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/a1.in" , filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 )
2475
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/b1.in" , filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 )
2476
2476
2477
2477
// Validate files are downloaded by build number
2478
2478
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (tests .Out , false )
@@ -2503,7 +2503,7 @@ func TestArtifactoryDownloadByBuildNoPatternUsingSimpleDownload(t *testing.T) {
2503
2503
artifactoryCli .Exec ("build-publish" , tests .RtBuildName1 , buildNumberB )
2504
2504
2505
2505
// Download by build number, a1 should not be downloaded, b1 should
2506
- artifactoryCli .Exec ("download * " + filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 + "/" + buildNumberA )
2506
+ artifactoryCli .Exec ("download" , "*" , filepath .Join (tests .Out , "download" , "simple_by_build" )+ fileutils .GetFileSeparator (), "--build=" + tests .RtBuildName1 + "/" + buildNumberA )
2507
2507
2508
2508
// Validate files are downloaded by build number
2509
2509
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (tests .Out , false )
@@ -2611,7 +2611,7 @@ func TestArtifactoryDownloadExcludeByCli(t *testing.T) {
2611
2611
artifactoryCli .Exec ("upload" , "--spec=" + specFileB , "--recursive=true" )
2612
2612
2613
2613
// Download by pattern
2614
- artifactoryCli .Exec ("download" , tests .RtRepo1 + " out/download/aql_by_artifacts/" , "--exclude-patterns=*/a1.in;*a2.*;data/c2.in" )
2614
+ artifactoryCli .Exec ("download" , tests .RtRepo1 , " out/download/aql_by_artifacts/" , "--exclude-patterns=*/a1.in;*a2.*;data/c2.in" )
2615
2615
2616
2616
// Validate files are excluded
2617
2617
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (tests .Out , false )
@@ -2634,7 +2634,7 @@ func TestArtifactoryDownloadExclusionsByCli(t *testing.T) {
2634
2634
artifactoryCli .Exec ("upload" , "--spec=" + specFileB , "--recursive=true" )
2635
2635
2636
2636
// Download by pattern
2637
- artifactoryCli .Exec ("download" , tests .RtRepo1 + " out/download/aql_by_artifacts/" , "--exclusions=*/*/a1.in;*/*a2.*;*/data/c2.in" )
2637
+ artifactoryCli .Exec ("download" , tests .RtRepo1 , " out/download/aql_by_artifacts/" , "--exclusions=*/*/a1.in;*/*a2.*;*/data/c2.in" )
2638
2638
2639
2639
// Validate files are excluded
2640
2640
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (tests .Out , false )
@@ -2759,10 +2759,10 @@ func TestArtifactoryLimitWithSymlink(t *testing.T) {
2759
2759
link := filepath .Join (tests .GetTestResourcesPath ()+ "a" , "link" )
2760
2760
err := os .Symlink (localFile , link )
2761
2761
assert .NoError (t , err )
2762
- artifactoryCli .Exec ("u" , link + " " + tests .RtRepo1 + " --symlinks=true" )
2762
+ artifactoryCli .Exec ("u" , link , tests .RtRepo1 , " --symlinks=true" )
2763
2763
err = os .Remove (link )
2764
2764
assert .NoError (t , err )
2765
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/ --validate-symlinks=true --limit=1" )
2765
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" , " --validate-symlinks=true" , " --limit=1" )
2766
2766
validateSortLimitWithSymLink (link , localFile , t )
2767
2767
os .Remove (link )
2768
2768
cleanArtifactoryTest ()
@@ -2780,10 +2780,10 @@ func TestArtifactorySortWithSymlink(t *testing.T) {
2780
2780
link := filepath .Join (tests .GetTestResourcesPath ()+ "a" , "link" )
2781
2781
err := os .Symlink (localFile , link )
2782
2782
assert .NoError (t , err )
2783
- artifactoryCli .Exec ("u" , link + " " + tests .RtRepo1 + " --symlinks=true" )
2783
+ artifactoryCli .Exec ("u" , link , tests .RtRepo1 , " --symlinks=true" )
2784
2784
err = os .Remove (link )
2785
2785
assert .NoError (t , err )
2786
- artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link " + tests .GetTestResourcesPath ()+ "a/ --validate-symlinks=true --sort-by=created" )
2786
+ artifactoryCli .Exec ("dl" , tests .RtRepo1 + "/link" , tests .GetTestResourcesPath ()+ "a/" , " --validate-symlinks=true" , " --sort-by=created" )
2787
2787
validateSortLimitWithSymLink (link , localFile , t )
2788
2788
os .Remove (link )
2789
2789
cleanArtifactoryTest ()
@@ -2817,7 +2817,7 @@ func TestArtifactoryDownloadByShaAndBuildNameWithSort(t *testing.T) {
2817
2817
artifactoryCli .Exec ("build-publish" , tests .RtBuildName2 , buildNumberB )
2818
2818
2819
2819
// Download by build number
2820
- artifactoryCli .Exec ("download" , "--sort-by=created --spec=" + specFile )
2820
+ artifactoryCli .Exec ("download" , "--sort-by=created" , " --spec="+ specFile )
2821
2821
2822
2822
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (filepath .Join (tests .Out , "download" , "sort_limit_by_build" ), false )
2823
2823
err = tests .ValidateListsIdentical (tests .GetBuildDownloadByShaAndBuildNameWithSort (), paths )
@@ -2898,10 +2898,10 @@ func TestArtifactorySortAndLimit(t *testing.T) {
2898
2898
artifactoryCli .Exec ("upload" , "testdata/a/(*)" , tests .RtRepo1 + "/data/{1}" )
2899
2899
2900
2900
// Download 1 sorted by name asc
2901
- artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/ out/download/sort_limit/" , "--sort-by=name" , "--limit=1" )
2901
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/" , " out/download/sort_limit/" , "--sort-by=name" , "--limit=1" )
2902
2902
2903
2903
// Download 3 sorted by depth desc
2904
- artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/ out/download/sort_limit/" , "--sort-by=depth" , "--limit=3" , "--sort-order=desc" )
2904
+ artifactoryCli .Exec ("download" , tests .RtRepo1 + "/data/" , " out/download/sort_limit/" , "--sort-by=depth" , "--limit=3" , "--sort-order=desc" )
2905
2905
2906
2906
paths , _ := fileutils .ListFilesRecursiveWalkIntoDirSymlink (tests .Out , false )
2907
2907
err := tests .ValidateListsIdentical (tests .GetSortAndLimit (), paths )
@@ -3006,7 +3006,7 @@ func TestArtifactoryCopyByBuildOverridingByInlineFlag(t *testing.T) {
3006
3006
artifactoryCli .Exec ("build-publish" , tests .RtBuildName1 , buildNumberB )
3007
3007
3008
3008
// Copy by build number: using override of build by flag from inline (no number set so LATEST build should be copied), a* should be copied
3009
- artifactoryCli .Exec ("copy" , "--build=" + tests .RtBuildName1 + " --spec="+ specFile )
3009
+ artifactoryCli .Exec ("copy" , "--build=" + tests .RtBuildName1 , " --spec="+ specFile )
3010
3010
3011
3011
// Validate files are Copied by build number
3012
3012
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -3039,7 +3039,7 @@ func TestArtifactoryMoveByBuildUsingFlags(t *testing.T) {
3039
3039
artifactoryCli .Exec ("build-publish" , tests .RtBuildName1 , buildNumberB )
3040
3040
3041
3041
// Move by build name and number
3042
- artifactoryCli .Exec ("move" , "--build=" + tests .RtBuildName1 + "/11 --spec=" + specFile )
3042
+ artifactoryCli .Exec ("move" , "--build=" + tests .RtBuildName1 + "/11" , " --spec="+ specFile )
3043
3043
3044
3044
// Validate files are moved by build number
3045
3045
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -3068,7 +3068,7 @@ func TestArtifactoryMoveExcludeByCli(t *testing.T) {
3068
3068
artifactoryCli .Exec ("upload" , "--spec=" + specFileB )
3069
3069
3070
3070
// Move by pattern
3071
- artifactoryCli .Exec ("move" , tests .RtRepo1 + "/data/ " + tests .RtRepo2 + "/" , "--exclude-patterns=*b*;*c*" )
3071
+ artifactoryCli .Exec ("move" , tests .RtRepo1 + "/data/" , tests .RtRepo2 + "/" , "--exclude-patterns=*b*;*c*" )
3072
3072
3073
3073
// Validate excluded files didn't move
3074
3074
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -3092,7 +3092,7 @@ func TestArtifactoryMoveExclusionsByCli(t *testing.T) {
3092
3092
artifactoryCli .Exec ("upload" , "--spec=" + specFileB )
3093
3093
3094
3094
// Move by pattern
3095
- artifactoryCli .Exec ("move" , tests .RtRepo1 + "/data/ " + tests .RtRepo2 + "/" , "--exclusions=*/*b*;*/*c*" )
3095
+ artifactoryCli .Exec ("move" , tests .RtRepo1 + "/data/" , tests .RtRepo2 + "/" , "--exclusions=*/*b*;*/*c*" )
3096
3096
3097
3097
// Validate excluded files didn't move
3098
3098
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -3176,7 +3176,7 @@ func TestArtifactoryDeleteByLatestBuild(t *testing.T) {
3176
3176
artifactoryCli .Exec ("build-publish" , tests .RtBuildName1 , buildNumberB )
3177
3177
3178
3178
// Delete by build name and LATEST
3179
- artifactoryCli .Exec ("delete" , "--build=" + tests .RtBuildName1 + "/LATEST --spec=" + specFile )
3179
+ artifactoryCli .Exec ("delete" , "--build=" + tests .RtBuildName1 + "/LATEST" , " --spec="+ specFile )
3180
3180
3181
3181
// Validate files are deleted by build number
3182
3182
cpMvDlByBuildAssertSpec , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
@@ -3607,8 +3607,8 @@ func cleanArtifactoryTest() {
3607
3607
func preUploadBasicTestResources () {
3608
3608
uploadPath := tests .GetTestResourcesPath () + "a/(.*)"
3609
3609
targetPath := tests .RtRepo1 + "/test_resources/{1}"
3610
- flags := "--threads=10 --regexp=true --props=searchMe=true --flat=false"
3611
- artifactoryCli . Exec ( "upload " , uploadPath , targetPath , flags )
3610
+ artifactoryCli . Exec ( "upload" , uploadPath , targetPath ,
3611
+ "--threads=10 " , "--regexp=true" , "--props=searchMe=true" , "--flat=false" )
3612
3612
}
3613
3613
3614
3614
func execDeleteRepo (repoName string ) {
@@ -3888,15 +3888,15 @@ func testCopyMoveNoSpec(command string, beforeCommandExpected, afterCommandExpec
3888
3888
artifactoryCli .Exec ("upload" , "--spec=" + specFileB )
3889
3889
3890
3890
// Run command with dry-run
3891
- artifactoryCli .Exec (command , tests .RtRepo1 + "/data/*a* " + tests .RtRepo2 + "/" , "--dry-run" )
3891
+ artifactoryCli .Exec (command , tests .RtRepo1 + "/data/*a*" , tests .RtRepo2 + "/" , "--dry-run" )
3892
3892
3893
3893
// Validate files weren't affected
3894
3894
cpMvSpecFilePath , err := tests .CreateSpec (tests .CpMvDlByBuildAssertSpec )
3895
3895
assert .NoError (t , err )
3896
3896
verifyExistInArtifactory (beforeCommandExpected , cpMvSpecFilePath , t )
3897
3897
3898
3898
// Run command
3899
- artifactoryCli .Exec (command , tests .RtRepo1 + "/data/*a* " + tests .RtRepo2 + "/" )
3899
+ artifactoryCli .Exec (command , tests .RtRepo1 + "/data/*a*" , tests .RtRepo2 + "/" )
3900
3900
3901
3901
// Validate files were affected
3902
3902
verifyExistInArtifactory (afterCommandExpected , cpMvSpecFilePath , t )
0 commit comments