Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr committed Aug 16, 2024
1 parent c315c89 commit 7ce99b0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/rekt/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"testing"
"time"

"knative.dev/eventing/test/rekt/features/authz"
"knative.dev/reconciler-test/pkg/feature"

"github.com/cloudevents/sdk-go/v2/binding"
Expand All @@ -39,6 +40,7 @@ import (
"knative.dev/eventing/test/rekt/features/channel"
"knative.dev/eventing/test/rekt/features/oidc"
ch "knative.dev/eventing/test/rekt/resources/channel"
channelresource "knative.dev/eventing/test/rekt/resources/channel"
"knative.dev/eventing/test/rekt/resources/channel_impl"
"knative.dev/eventing/test/rekt/resources/subscription"
)
Expand Down Expand Up @@ -392,3 +394,39 @@ func TestChannelImplSupportsOIDC(t *testing.T) {

env.TestSet(ctx, t, oidc.AddressableOIDCConformance(channel_impl.GVR(), channel_impl.GVK().Kind, name, env.Namespace()))
}

func TestChannelImplSupportsAuthZ(t *testing.T) {
t.Parallel()

ctx, env := global.Environment(
knative.WithKnativeNamespace(system.Namespace()),
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
environment.Managed(t),
eventshub.WithTLS(t),
)

name := feature.MakeRandomK8sName("channelimpl")
env.Prerequisite(ctx, t, channel.ImplGoesReady(name))

env.TestSet(ctx, t, authz.AddressableAuthZConformance(channel_impl.GVR(), channel_impl.GVK().Kind, name))
}

func TestChannelSupportsAuthZ(t *testing.T) {
t.Parallel()

ctx, env := global.Environment(
knative.WithKnativeNamespace(system.Namespace()),
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
environment.Managed(t),
eventshub.WithTLS(t),
)

name := feature.MakeRandomK8sName("channel")
env.Prerequisite(ctx, t, channel.GoesReady(name))

env.TestSet(ctx, t, authz.AddressableAuthZConformance(channelresource.GVR(), "Channel", name))
}

0 comments on commit 7ce99b0

Please sign in to comment.