From f396dc53db99ee5d36a69804a583a067b5bc1ec6 Mon Sep 17 00:00:00 2001 From: Tulsishah <46474643+Tulsishah@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:46:16 +0530 Subject: [PATCH] Integration tests for key-file flag with viewer permission tests (#1228) * testing with viewer permission * testing on operations * testing on operations * final testing * testing * testing --- tools/integration_tests/readonly/readonly_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/integration_tests/readonly/readonly_test.go b/tools/integration_tests/readonly/readonly_test.go index 75df9fce8e..a9636152ea 100644 --- a/tools/integration_tests/readonly/readonly_test.go +++ b/tools/integration_tests/readonly/readonly_test.go @@ -21,6 +21,7 @@ import ( "strings" "testing" + "github.com/googlecloudplatform/gcsfuse/tools/integration_tests/util/creds_tests" "github.com/googlecloudplatform/gcsfuse/tools/integration_tests/util/mounting/static_mounting" "github.com/googlecloudplatform/gcsfuse/tools/integration_tests/util/setup" ) @@ -78,6 +79,11 @@ func TestMain(m *testing.M) { setup.SetUpTestDirForTestBucketFlag() successCode := static_mounting.RunTests(flags, m) + if successCode == 0 { + // Test for viewer permission on test bucket. + successCode = creds_tests.RunTestsForKeyFileAndGoogleApplicationCredentialsEnvVarSet(flags, "objectViewer", m) + } + // Delete objects from bucket after testing. setup.RunScriptForTestData("testdata/delete_objects.sh", setup.TestBucket())