Skip to content

Commit

Permalink
fix: e2e test dfget recursive (#2458)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Jun 13, 2023
1 parent afd81b3 commit 0bbd437
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkg/source/clients/s3protocol/s3_source_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ func (s *s3SourceClient) GetLastModified(request *source.Request) (int64, error)
func (s *s3SourceClient) List(request *source.Request) (urls []source.URLEntry, err error) {
client, err := s.newAWSS3Client(request)
if err != nil {
return nil, fmt.Errorf("get oss client: %w", err)
return nil, fmt.Errorf("get s3 client: %w", err)
}
// if it's a object, just return it.
// if it's an object, just return it.
isDir, err := s.isDirectory(client, request)
if err != nil {
return nil, err
Expand Down Expand Up @@ -255,7 +255,7 @@ func (s *s3SourceClient) isDirectory(client *s3.S3, request *source.Request) (bo
Delimiter: &delimiter,
})
if err != nil {
return false, fmt.Errorf("list oss object %s/%s: %w", request.URL.Host, uPath, err)
return false, fmt.Errorf("list s3 object %s/%s: %w", request.URL.Host, uPath, err)
}
if len(output.Contents)+len(output.CommonPrefixes) > 0 {
return true, nil
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/dfget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ func singleDfgetTest(name, ns, label, podNamePrefix, container string) {
return
}

// prepaired data in minio pod
// prepared data in minio pod
// test bucket minio-test-bucket
// test path /dragonfly-test/usr
// test subdirs (no empty dirs)
// test sub dirs (no empty dirs)
// sha256sum txt: /host/tmp/dragonfly-test.sha256sum.txt
subDirs := []string{"bin", "lib64", "libexec", "sbin"}

Expand Down Expand Up @@ -227,10 +227,10 @@ func singleDfgetTest(name, ns, label, podNamePrefix, container string) {
return
}

// prepaired data in minio pod
// prepared data in minio pod
// test bucket minio-test-bucket
// test path /dragonfly-test/usr
// test subdirs (no empty dirs)
// test sub dirs (no empty dirs)
// sha256sum txt: /host/tmp/dragonfly-test.sha256sum.txt
subDirs := []string{"bin", "lib64", "libexec", "sbin"}

Expand Down
3 changes: 2 additions & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ var _ = AfterSuite(func() {
out, err = pod.Command("sh", "-c", fmt.Sprintf(`
set -x
cp -r /var/log/dragonfly/%s /tmp/artifact/%s-%d
cp -r /var/log/dragonfly/dfget /tmp/artifact/%s-%d-dfget
find /tmp/artifact -type d -exec chmod 777 {} \;
`, server.logDirName, server.name, i)).CombinedOutput()
`, server.logDirName, server.name, i, server.name, i)).CombinedOutput()
if err != nil {
fmt.Printf("copy log output: %q, error: %s, retry after 10s\n", string(out), err)
// pod maybe restart due to panic, wait it running again
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/k8s/minio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
containers:
- name: minio
# Pull image with dragonfly
image: minio/minio:latest
image: minio/minio:RELEASE.2022-11-11T03-44-20Z
imagePullPolicy: "IfNotPresent"
command:
- /opt/bin/minio
Expand Down

0 comments on commit 0bbd437

Please sign in to comment.