Skip to content

Commit

Permalink
Merge branch 'main' into fix-removal-named-volumes
Browse files Browse the repository at this point in the history
* main:
  [redpanda] sasl test for wrong mechanism (testcontainers#2048)
  • Loading branch information
mdelapenya committed Feb 2, 2024
2 parents ffcebc7 + bdab82e commit d0d2d74
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/redpanda/redpanda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/twmb/franz-go/pkg/kadm"
"github.com/twmb/franz-go/pkg/kerr"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/twmb/franz-go/pkg/sasl/plain"
"github.com/twmb/franz-go/pkg/sasl/scram"

"github.com/testcontainers/testcontainers-go"
Expand Down Expand Up @@ -162,6 +163,23 @@ func TestRedpandaWithAuthentication(t *testing.T) {
require.ErrorContains(t, err, "SASL_AUTHENTICATION_FAILED")
}

// Test wrong mechanism
{
kafkaCl, err := kgo.NewClient(
kgo.SeedBrokers(seedBroker),
kgo.SASL(plain.Auth{
User: "no-superuser",
Pass: "test",
}.AsMechanism()),
)
require.NoError(t, err)

kafkaAdmCl := kadm.NewClient(kafkaCl)
_, err = kafkaAdmCl.Metadata(ctx)
require.Error(t, err)
require.ErrorContains(t, err, "UNSUPPORTED_SASL_MECHANISM")
}

// Test Schema Registry API
httpCl := &http.Client{Timeout: 5 * time.Second}
// schemaRegistryAddress {
Expand Down

0 comments on commit d0d2d74

Please sign in to comment.