-
Notifications
You must be signed in to change notification settings - Fork 109
/
postdowngrade.go
66 lines (58 loc) · 2.3 KB
/
postdowngrade.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright 2021 The Knative Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package upgrade
import (
pkgupgrade "knative.dev/pkg/test/upgrade"
"knative.dev/reconciler-test/pkg/environment"
eventing "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/eventing/v1alpha1"
"knative.dev/eventing-kafka-broker/control-plane/pkg/kafka"
"knative.dev/eventing-kafka-broker/test/e2e_sink"
)
// BrokerPostDowngradeTest tests channel basic channel operations after
// downgrade.
func BrokerPostDowngradeTest() pkgupgrade.Operation {
return pkgupgrade.NewOperation("BrokerPostDowngradeTest", func(c pkgupgrade.Context) {
runBrokerSmokeTest(c.T, kafka.BrokerClass)
})
}
// NamespacedBrokerPostDowngradeTest tests basic namespaced broker operations after
// downgrade.
func NamespacedBrokerPostDowngradeTest() pkgupgrade.Operation {
return pkgupgrade.NewOperation("NamespacedBrokerPostDowngradeTest", func(c pkgupgrade.Context) {
runBrokerSmokeTest(c.T, kafka.NamespacedBrokerClass)
})
}
// ChannelPostDowngradeTest tests channel basic channel operations after
// downgrade.
func ChannelPostDowngradeTest() pkgupgrade.Operation {
return pkgupgrade.NewOperation("ChannelPostDowngradeTest",
func(c pkgupgrade.Context) {
runChannelSmokeTest(c.T)
})
}
// SinkPostDowngradeTest tests sink basic operations after downgrade.
func SinkPostDowngradeTest() pkgupgrade.Operation {
return pkgupgrade.NewOperation("SinkPostDowngradeTest", func(c pkgupgrade.Context) {
e2e_sink.RunTestKafkaSink(c.T, eventing.ModeBinary, nil)
})
}
// SourcePostDowngradeTest tests source operations after downgrade.
func SourcePostDowngradeTest(glob environment.GlobalEnvironment) pkgupgrade.Operation {
return pkgupgrade.NewOperation("SourcePostDowngradeTest",
func(c pkgupgrade.Context) {
runSourceSmokeTest(glob, c.T)
})
}