diff --git a/cmd/versitygw/test.go b/cmd/versitygw/test.go index b39b1cbd..2c885e30 100644 --- a/cmd/versitygw/test.go +++ b/cmd/versitygw/test.go @@ -38,6 +38,7 @@ var ( checksumDisable bool versioningEnabled bool azureTests bool + sidecarTests bool tlsStatus bool parallel bool ) @@ -116,6 +117,12 @@ func initTestCommands() []*cli.Command { Destination: &azureTests, Aliases: []string{"azure"}, }, + &cli.BoolFlag{ + Name: "sidecar-test-mode", + Usage: "Skips tests that are not supported by Sidecar", + Destination: &sidecarTests, + Aliases: []string{"sidecar"}, + }, &cli.BoolFlag{ Name: "parallel", Usage: "executes the tests concurrently", @@ -336,6 +343,9 @@ func getAction(tf testFunc) func(ctx *cli.Context) error { if azureTests { opts = append(opts, integration.WithAzureMode()) } + if sidecarTests { + opts = append(opts, integration.WithSidecarMode()) + } if hostStyle { opts = append(opts, integration.WithHostStyle()) } @@ -382,6 +392,9 @@ func extractIntTests() (commands []*cli.Command) { if azureTests { opts = append(opts, integration.WithAzureMode()) } + if sidecarTests { + opts = append(opts, integration.WithSidecarMode()) + } s := integration.NewS3Conf(opts...) err := testFunc(s) @@ -400,6 +413,12 @@ func extractIntTests() (commands []*cli.Command) { Destination: &azureTests, Aliases: []string{"azure"}, }, + &cli.BoolFlag{ + Name: "sidecar-test-mode", + Usage: "Skips tests that are not supported by Sidecar", + Destination: &sidecarTests, + Aliases: []string{"sidecar"}, + }, }, }) } diff --git a/runtests.sh b/runtests.sh index f0afff56..497413b4 100755 --- a/runtests.sh +++ b/runtests.sh @@ -10,10 +10,12 @@ done # build sidecar flag for versitygw invocations SIDECAR_FLAG="" +SIDECAR_TEST_FLAG="" if $USE_SIDECAR; then rm -rf /tmp/sidecar mkdir /tmp/sidecar SIDECAR_FLAG="--sidecar /tmp/sidecar" + SIDECAR_TEST_FLAG="--sidecar" fi # make temp dirs @@ -55,7 +57,7 @@ fi # run tests # full flow tests -if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow --parallel; then +if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow --parallel $$SIDECAR_TEST_FLAG; then echo "full flow tests failed" kill $GW_PID exit 1 @@ -92,7 +94,7 @@ fi # run tests # full flow tests -if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7071 full-flow --parallel; then +if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7071 full-flow --parallel $$SIDECAR_TEST_FLAG; then echo "full flow tests failed" kill $GW_HTTPS_PID exit 1 @@ -129,7 +131,7 @@ fi # run tests # full flow tests -if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7072 full-flow -vs --parallel; then +if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7072 full-flow -vs --parallel $$SIDECAR_TEST_FLAG; then echo "versioning-enabled full-flow tests failed" kill $GW_VS_PID exit 1 @@ -161,7 +163,7 @@ fi # run tests # full flow tests -if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7073 full-flow -vs --parallel; then +if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7073 full-flow -vs --parallel $$SIDECAR_TEST_FLAG; then echo "versioning-enabled full-flow tests failed" kill $GW_VS_HTTPS_PID exit 1 diff --git a/tests/integration/group-tests.go b/tests/integration/group-tests.go index fb1f4aef..74dbeb94 100644 --- a/tests/integration/group-tests.go +++ b/tests/integration/group-tests.go @@ -551,7 +551,7 @@ func TestCompleteMultipartUpload(ts *TestState) { } ts.Run(CompleteMultipartUpload_success) ts.Run(CompleteMultipartUpload_already_completed) - if !ts.conf.azureTests { + if !(ts.conf.azureTests || ts.conf.sidecarTests) { ts.Run(CompleteMultipartUpload_racey_success) ts.Run(CompleteMultipartUpload_racey_data_integrity) } diff --git a/tests/integration/s3conf.go b/tests/integration/s3conf.go index 879214d5..e49b892b 100644 --- a/tests/integration/s3conf.go +++ b/tests/integration/s3conf.go @@ -43,6 +43,7 @@ type S3Conf struct { debug bool versioningEnabled bool azureTests bool + sidecarTests bool tlsStatus bool httpClient *http.Client } @@ -105,6 +106,9 @@ func WithVersioningEnabled() Option { func WithAzureMode() Option { return func(s *S3Conf) { s.azureTests = true } } +func WithSidecarMode() Option { + return func(s *S3Conf) { s.sidecarTests = true } +} func WithTLSStatus(ts bool) Option { return func(s *S3Conf) { s.tlsStatus = ts } }