File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ func TestValidation(t *testing.T) {
1111 // These should fail:
1212 // Leading character before gs://
1313 _ , err := etl .ValidateTestPath (
14- `xgs://m-lab-sandbox/ndt/2016/01/26/20160126T000000Z -mlab1-prg01-ndt-0007.tgz` )
14+ `xgs://m-lab-sandbox/ndt/2016/01/26/20160126T123456Z -mlab1-prg01-ndt-0007.tgz` )
1515 if err == nil {
1616 t .Error ("Should be invalid: " )
1717 }
@@ -35,12 +35,12 @@ func TestValidation(t *testing.T) {
3535 t .Error (err )
3636 }
3737 data , err = etl .ValidateTestPath (
38- `gs://m-lab-sandbox/ndt/2016/07/14/20160714T000000Z -mlab1-lax04-ndt-0001.tar` )
38+ `gs://m-lab-sandbox/ndt/2016/07/14/20160714T123456Z -mlab1-lax04-ndt-0001.tar` )
3939 if err != nil {
4040 t .Error (err )
4141 }
4242 data , err = etl .ValidateTestPath (
43- `gs://m-lab-sandbox/ndt/2016/07/14/20160714T000000Z -mlab1-lax04-ndt-0001.tar.gz` )
43+ `gs://m-lab-sandbox/ndt/2016/07/14/20160714T123456Z -mlab1-lax04-ndt-0001.tar.gz` )
4444 if err != nil {
4545 t .Error (err )
4646 }
Original file line number Diff line number Diff line change 77
88const start = `^gs://(?P<prefix>.*)/(?P<exp>[^/]*)/`
99const datePath = `(?P<datepath>\d{4}/[01]\d/[0123]\d)/`
10- const dateTime = `(\d{4}[01]\d[0123]\d)T000000Z `
10+ const dateTime = `(\d{4}[01]\d[0123]\d)T\d{6}Z `
1111const mlabN_podNN = `-(mlab\d)-([[:alpha:]]{3}\d[0-9t])-`
1212const exp_NNNN = `(.*)-(\d{4})`
1313const suffix = `(?:\.tar|\.tar.gz|\.tgz)$`
1818 // This matches any valid test file name, and some invalid ones.
1919 TaskPattern = regexp .MustCompile (start + // #1 #2
2020 datePath + // #3 - YYYY/MM/DD
21- dateTime + // #4 - YYYYMMDDT000000Z
21+ dateTime + // #4 - YYYYMMDDTHHMMSSZ
2222 mlabN_podNN + // #5 #6 - e.g. -mlab1-lax04-
2323 exp_NNNN + // #7 #8 e.g. ndt-0001
2424 suffix ) // #9 typically .tgz
You can’t perform that action at this time.
0 commit comments