@@ -47,14 +47,6 @@ func AssertLifecycleWorks(gcsCLIPath string, ctx AssertContext) {
4747 Expect (session .ExitCode ()).To (BeZero ())
4848 Expect (session .Err .Contents ()).To (MatchRegexp ("File '.*' exists in bucket '.*'" ))
4949
50- session , err = RunGCSCLI (gcsCLIPath , ctx .ConfigPath , storageType , "properties" , ctx .GCSFileName )
51- Expect (err ).ToNot (HaveOccurred ())
52- Expect (session .ExitCode ()).To (BeZero ())
53- output := string (session .Out .Contents ())
54- Expect (output ).To (MatchRegexp (`"etag":\s*".+?"` ))
55- Expect (output ).To (MatchRegexp (`"last_modified":\s*".+?"` ))
56- Expect (output ).To (MatchRegexp (`"content_length":\s*\d+` ))
57-
5850 tmpLocalFileName := "gcscli-download"
5951 defer os .Remove (tmpLocalFileName ) //nolint:errcheck
6052
@@ -206,3 +198,28 @@ func AssertListMultipleWithPrefixLifecycle(gcsCLIPath string, ctx AssertContext)
206198 Expect (err ).ToNot (HaveOccurred ())
207199 Expect (session .ExitCode ()).To (BeZero ())
208200}
201+
202+ func AssertPropertiesLifecycle (gcsCLIPath string , ctx AssertContext ) {
203+ storageType := "gcs"
204+ session , err := RunGCSCLI (gcsCLIPath , ctx .ConfigPath , storageType , "put" , ctx .ContentFile , ctx .GCSFileName )
205+ Expect (err ).ToNot (HaveOccurred ())
206+ Expect (session .ExitCode ()).To (BeZero ())
207+
208+ session , err = RunGCSCLI (gcsCLIPath , ctx .ConfigPath , storageType , "properties" , ctx .GCSFileName )
209+ Expect (err ).ToNot (HaveOccurred ())
210+ Expect (session .ExitCode ()).To (BeZero ())
211+ output := string (session .Out .Contents ())
212+ Expect (output ).To (MatchRegexp (`"etag":\s*".+?"` ))
213+ Expect (output ).To (MatchRegexp (`"last_modified":\s*".+?"` ))
214+ Expect (output ).To (MatchRegexp (`"content_length":\s*\d+` ))
215+
216+ session , err = RunGCSCLI (gcsCLIPath , ctx .ConfigPath , storageType , "delete" , ctx .GCSFileName )
217+ Expect (err ).ToNot (HaveOccurred ())
218+ Expect (session .ExitCode ()).To (BeZero ())
219+
220+ session , err = RunGCSCLI (gcsCLIPath , ctx .ConfigPath , storageType , "properties" , ctx .GCSFileName )
221+ Expect (err ).ToNot (HaveOccurred ())
222+ Expect (session .ExitCode ()).To (BeZero ())
223+ Expect (string (session .Out .Contents ())).To (MatchRegexp ("{}" ))
224+
225+ }
0 commit comments