@@ -17,6 +17,7 @@ var _ = Describe("General testing for all Ali regions", func() {
1717 var blobName string
1818 var configPath string
1919 var contentFile string
20+ var storageType = "alioss"
2021
2122 BeforeEach (func () {
2223 blobName = integration .GenerateRandomString ()
@@ -32,16 +33,16 @@ var _ = Describe("General testing for all Ali regions", func() {
3233 Describe ("Invoking `put`" , func () {
3334 It ("uploads a file" , func () {
3435 defer func () {
35- cliSession , err := integration .RunCli (cliPath , configPath , "delete" , blobName )
36+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
3637 Expect (err ).ToNot (HaveOccurred ())
3738 Expect (cliSession .ExitCode ()).To (BeZero ())
3839 }()
3940
40- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
41+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
4142 Expect (err ).ToNot (HaveOccurred ())
4243 Expect (cliSession .ExitCode ()).To (BeZero ())
4344
44- cliSession , err = integration .RunCli (cliPath , configPath , "exists" , blobName )
45+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "exists" , blobName )
4546 Expect (err ).ToNot (HaveOccurred ())
4647 Expect (cliSession .ExitCode ()).To (BeZero ())
4748
@@ -50,7 +51,7 @@ var _ = Describe("General testing for all Ali regions", func() {
5051
5152 It ("overwrites an existing file" , func () {
5253 defer func () {
53- cliSession , err := integration .RunCli (cliPath , configPath , "delete" , blobName )
54+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
5455 Expect (err ).ToNot (HaveOccurred ())
5556 Expect (cliSession .ExitCode ()).To (BeZero ())
5657 }()
@@ -60,23 +61,23 @@ var _ = Describe("General testing for all Ali regions", func() {
6061 defer func () { _ = os .Remove (tmpLocalFile .Name ()) }() //nolint:errcheck
6162
6263 contentFile = integration .MakeContentFile ("initial content" )
63- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
64+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
6465 Expect (err ).ToNot (HaveOccurred ())
6566 Expect (cliSession .ExitCode ()).To (BeZero ())
6667
67- cliSession , err = integration .RunCli (cliPath , configPath , "get" , blobName , tmpLocalFile .Name ())
68+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "get" , blobName , tmpLocalFile .Name ())
6869 Expect (err ).ToNot (HaveOccurred ())
6970 Expect (cliSession .ExitCode ()).To (BeZero ())
7071
7172 gottenBytes , _ := os .ReadFile (tmpLocalFile .Name ()) //nolint:errcheck
7273 Expect (string (gottenBytes )).To (Equal ("initial content" ))
7374
7475 contentFile = integration .MakeContentFile ("updated content" )
75- cliSession , err = integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
76+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
7677 Expect (err ).ToNot (HaveOccurred ())
7778 Expect (cliSession .ExitCode ()).To (BeZero ())
7879
79- cliSession , err = integration .RunCli (cliPath , configPath , "get" , blobName , tmpLocalFile .Name ())
80+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "get" , blobName , tmpLocalFile .Name ())
8081 Expect (err ).ToNot (HaveOccurred ())
8182 Expect (cliSession .ExitCode ()).To (BeZero ())
8283
@@ -94,7 +95,7 @@ var _ = Describe("General testing for all Ali regions", func() {
9495
9596 configPath = integration .MakeConfigFile (cfg )
9697
97- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
98+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
9899 Expect (err ).ToNot (HaveOccurred ())
99100 Expect (cliSession .ExitCode ()).To (Equal (1 ))
100101
@@ -108,18 +109,18 @@ var _ = Describe("General testing for all Ali regions", func() {
108109 outputFilePath := "/tmp/" + integration .GenerateRandomString ()
109110
110111 defer func () {
111- cliSession , err := integration .RunCli (cliPath , configPath , "delete" , blobName )
112+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
112113 Expect (err ).ToNot (HaveOccurred ())
113114 Expect (cliSession .ExitCode ()).To (BeZero ())
114115
115116 _ = os .Remove (outputFilePath ) //nolint:errcheck
116117 }()
117118
118- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
119+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
119120 Expect (err ).ToNot (HaveOccurred ())
120121 Expect (cliSession .ExitCode ()).To (BeZero ())
121122
122- cliSession , err = integration .RunCli (cliPath , configPath , "get" , blobName , outputFilePath )
123+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "get" , blobName , outputFilePath )
123124 Expect (err ).ToNot (HaveOccurred ())
124125 Expect (cliSession .ExitCode ()).To (BeZero ())
125126
@@ -131,20 +132,20 @@ var _ = Describe("General testing for all Ali regions", func() {
131132 Describe ("Invoking `delete`" , func () {
132133 It ("deletes a file" , func () {
133134 defer func () {
134- cliSession , err := integration .RunCli (cliPath , configPath , "delete" , blobName )
135+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
135136 Expect (err ).ToNot (HaveOccurred ())
136137 Expect (cliSession .ExitCode ()).To (BeZero ())
137138 }()
138139
139- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
140+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
140141 Expect (err ).ToNot (HaveOccurred ())
141142 Expect (cliSession .ExitCode ()).To (BeZero ())
142143
143- cliSession , err = integration .RunCli (cliPath , configPath , "delete" , blobName )
144+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
144145 Expect (err ).ToNot (HaveOccurred ())
145146 Expect (cliSession .ExitCode ()).To (BeZero ())
146147
147- cliSession , err = integration .RunCli (cliPath , configPath , "exists" , blobName )
148+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "exists" , blobName )
148149 Expect (err ).ToNot (HaveOccurred ())
149150 Expect (cliSession .ExitCode ()).To (Equal (3 ))
150151 })
@@ -153,45 +154,45 @@ var _ = Describe("General testing for all Ali regions", func() {
153154 Describe ("Invoking `exists`" , func () {
154155 It ("returns 0 for an existing blob" , func () {
155156 defer func () {
156- cliSession , err := integration .RunCli (cliPath , configPath , "delete" , blobName )
157+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "delete" , blobName )
157158 Expect (err ).ToNot (HaveOccurred ())
158159 Expect (cliSession .ExitCode ()).To (BeZero ())
159160 }()
160161
161- cliSession , err := integration .RunCli (cliPath , configPath , "put" , contentFile , blobName )
162+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "put" , contentFile , blobName )
162163 Expect (err ).ToNot (HaveOccurred ())
163164 Expect (cliSession .ExitCode ()).To (BeZero ())
164165
165- cliSession , err = integration .RunCli (cliPath , configPath , "exists" , blobName )
166+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "exists" , blobName )
166167 Expect (err ).ToNot (HaveOccurred ())
167168 Expect (cliSession .ExitCode ()).To (Equal (0 ))
168169 })
169170
170171 It ("returns 3 for a not existing blob" , func () {
171- cliSession , err := integration .RunCli (cliPath , configPath , "exists" , blobName )
172+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "exists" , blobName )
172173 Expect (err ).ToNot (HaveOccurred ())
173174 Expect (cliSession .ExitCode ()).To (Equal (3 ))
174175 })
175176 })
176177
177178 Describe ("Invoking `sign`" , func () {
178179 It ("returns 0 for an existing blob" , func () {
179- cliSession , err := integration .RunCli (cliPath , configPath , "sign" , "some-blob" , "get" , "60s" )
180+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "sign" , "some-blob" , "get" , "60s" )
180181 Expect (err ).ToNot (HaveOccurred ())
181182 Expect (cliSession .ExitCode ()).To (BeZero ())
182183
183184 getUrl := bytes .NewBuffer (cliSession .Out .Contents ()).String ()
184185 Expect (getUrl ).To (MatchRegexp ("http://" + bucketName + "." + endpoint + "/some-blob" ))
185186
186- cliSession , err = integration .RunCli (cliPath , configPath , "sign" , "some-blob" , "put" , "60s" )
187+ cliSession , err = integration .RunCli (cliPath , configPath , storageType , "sign" , "some-blob" , "put" , "60s" )
187188 Expect (err ).ToNot (HaveOccurred ())
188189
189190 putUrl := bytes .NewBuffer (cliSession .Out .Contents ()).String ()
190191 Expect (putUrl ).To (MatchRegexp ("http://" + bucketName + "." + endpoint + "/some-blob" ))
191192 })
192193
193194 It ("returns 3 for a not existing blob" , func () {
194- cliSession , err := integration .RunCli (cliPath , configPath , "exists" , blobName )
195+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "exists" , blobName )
195196 Expect (err ).ToNot (HaveOccurred ())
196197 Expect (cliSession .ExitCode ()).To (Equal (3 ))
197198 })
@@ -202,7 +203,7 @@ var _ = Describe("General testing for all Ali regions", func() {
202203 configPath := integration .MakeConfigFile (& defaultConfig )
203204 defer func () { _ = os .Remove (configPath ) }() //nolint:errcheck
204205
205- cliSession , err := integration .RunCli (cliPath , configPath , "-v" )
206+ cliSession , err := integration .RunCli (cliPath , configPath , storageType , "-v" )
206207 Expect (err ).ToNot (HaveOccurred ())
207208 Expect (cliSession .ExitCode ()).To (Equal (0 ))
208209
0 commit comments