Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions cmd/openshift-tests/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/openshift/origin/pkg/test/ginkgo"
exutil "github.com/openshift/origin/test/extended/util"
"k8s.io/kubectl/pkg/util/templates"
_ "k8s.io/kubernetes/test/e2e/framework/debug/init"
_ "k8s.io/kubernetes/test/e2e/framework/metrics/init"

_ "github.com/openshift/origin/test/extended"
_ "github.com/openshift/origin/test/extended/util/annotate/generated"
Expand Down
3 changes: 3 additions & 0 deletions examples/hello-openshift/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/openshift/origin/examples/hello-openshift

go 1.19
228 changes: 114 additions & 114 deletions go.mod

Large diffs are not rendered by default.

430 changes: 232 additions & 198 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/update-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
ENABLE_STORAGE_GCE_PD_DRIVER=yes go generate -mod vendor ./test/extended

# Update mirror mapping from upstream to quay
echo "# This file is generated by hack/update-generated-bindata.sh" > test/extended/util/image/zz_generated.txt
echo "# This file is generated by hack/update-generated.sh" > test/extended/util/image/zz_generated.txt
go run -mod vendor ./cmd/openshift-tests images --upstream --to-repository quay.io/openshift/community-e2e-images >> test/extended/util/image/zz_generated.txt

os::build::setup_env
Expand Down
4 changes: 2 additions & 2 deletions images/hello-openshift/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.8 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13 AS builder
WORKDIR /go/src/github.com/openshift/hello-openshift
COPY examples/hello-openshift .
RUN go build -o /hello-openshift

FROM registry.ci.openshift.org/ocp/4.8:base
FROM registry.ci.openshift.org/ocp/4.13:base
COPY --from=builder /hello-openshift /hello-openshift
EXPOSE 8080 8888
USER 1001
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/ginkgo/options_monitor_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (o *MonitorEventsOptions) End(ctx context.Context, restConfig *rest.Config,
if d.IsDir() {
return nil
}
if !strings.HasPrefix(d.Name(), "AdditionalEvents_") {
if !strings.HasPrefix(d.Name(), "AdditionalEvents__") {
return nil
}
saved, _ := monitorserialization.EventsFromFile(path)
Expand Down
3 changes: 2 additions & 1 deletion test/extended/builds/multistage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2e "k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

buildv1 "github.com/openshift/api/build/v1"
Expand Down Expand Up @@ -96,7 +97,7 @@ COPY --from=%[2]s /bin/ping /test/
o.Expect(s).To(o.ContainSubstring("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace()))
e2e.Logf("Build logs:\n%s", result)

c := oc.KubeFramework().PodClient()
c := e2epod.PodClientNS(oc.KubeFramework(), oc.Namespace())
pod = c.Create(&corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Expand Down
5 changes: 3 additions & 2 deletions test/extended/builds/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
o "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
admissionapi "k8s.io/pod-security-admission/api"

exutil "github.com/openshift/origin/test/extended/util"
Expand Down Expand Up @@ -74,7 +75,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] can use build secrets", f

g.By("verifying the build sources were available during build and secrets were not present in the output image")
pod := exutil.GetPodForContainer(corev1.Container{Name: "test", Image: image})
oc.KubeFramework().TestContainerOutput("test-build-secret-source", pod, 0, []string{
e2eoutput.TestContainerOutput(oc.KubeFramework(), "test-build-secret-source", pod, 0, []string{
"testsecret/secret1=secret1",
"testsecret/secret2=secret2",
"testsecret/secret3=secret3",
Expand Down Expand Up @@ -105,7 +106,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] can use build secrets", f

g.By("verifying the build sources are present in container output")
pod := exutil.GetPodForContainer(corev1.Container{Name: "test", Image: image})
oc.KubeFramework().TestContainerOutput("test-build-secret-docker", pod, 0, []string{
e2eoutput.TestContainerOutput(oc.KubeFramework(), "test-build-secret-docker", pod, 0, []string{
"secret1=secret1",
"relative-secret2=secret2",
"foo=bar",
Expand Down
3 changes: 2 additions & 1 deletion test/extended/cli/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

exutil "github.com/openshift/origin/test/extended/util"
Expand All @@ -31,7 +32,7 @@ var _ = g.Describe("[sig-cli] oc", func() {

g.It("can run inside of a busybox container [apigroup:image.openshift.io]", func() {
ns := oc.Namespace()
cli := oc.KubeFramework().PodClient()
cli := e2epod.PodClientNS(oc.KubeFramework(), ns)

_, err := oc.KubeClient().RbacV1().RoleBindings(ns).Create(context.Background(), &rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{Name: "edit-for-builder"},
Expand Down
5 changes: 3 additions & 2 deletions test/extended/cluster/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
imageutils "k8s.io/kubernetes/test/utils/image"
)

Expand All @@ -35,8 +36,8 @@ var _ = g.Describe("[sig-api-machinery][Feature:Audit] Basic audit", func() {
}},
},
}
f.PodClient().CreateSync(pod)
f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout)
e2epod.NewPodClient(f).CreateSync(pod)
e2epod.NewPodClient(f).DeleteSync(pod.Name, metav1.DeleteOptions{}, e2epod.DefaultPodDeletionTimeout)

// Create, Read, Delete secret
secret := &apiv1.Secret{
Expand Down
23 changes: 11 additions & 12 deletions test/extended/dr/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"k8s.io/client-go/dynamic"
"k8s.io/kubernetes/test/e2e/framework"
e2e "k8s.io/kubernetes/test/e2e/framework"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"

"github.com/openshift/origin/test/e2e/upgrade"
Expand All @@ -42,14 +41,14 @@ func runCommandAndRetry(command string) string {
out []byte
err error
)
e2elog.Logf("command '%s'", command)
e2e.Logf("command '%s'", command)
for retryCount = 0; retryCount <= maxRetries; retryCount++ {
out, err = exec.Command("bash", "-c", command).CombinedOutput()
e2elog.Logf("output:\n%s", out)
e2e.Logf("output:\n%s", out)
if err == nil {
break
}
e2elog.Logf("%v", err)
e2e.Logf("%v", err)
time.Sleep(time.Second * pause)
}
o.Expect(retryCount).NotTo(o.Equal(maxRetries + 1))
Expand Down Expand Up @@ -84,7 +83,7 @@ func clusterNodes(oc *exutil.CLI) (masters, workers []*corev1.Node) {
}

func waitForMastersToUpdate(oc *exutil.CLI, mcps dynamic.NamespaceableResourceInterface) {
e2elog.Logf("Waiting for MachineConfig master to finish rolling out")
e2e.Logf("Waiting for MachineConfig master to finish rolling out")
err := wait.Poll(30*time.Second, 30*time.Minute, func() (done bool, err error) {
done, _ = upgrade.IsPoolUpdated(mcps, "master")
return done, nil
Expand Down Expand Up @@ -112,7 +111,7 @@ func waitForOperatorsToSettle() {
obj, err := coc.List(context.Background(), metav1.ListOptions{})
if err != nil {
lastErr = err
e2elog.Logf("Unable to check for cluster operators: %v", err)
e2e.Logf("Unable to check for cluster operators: %v", err)
return false, nil
}
cv := objx.Map(obj.UnstructuredContent())
Expand Down Expand Up @@ -150,7 +149,7 @@ func waitForOperatorsToSettle() {
}
}
if len(unavailable) > 0 {
e2elog.Logf("Operators still doing work: %s", strings.Join(unavailableNames, ", "))
e2e.Logf("Operators still doing work: %s", strings.Join(unavailableNames, ", "))
return false, nil
}
return true, nil
Expand Down Expand Up @@ -179,7 +178,7 @@ func waitForOperatorsToSettle() {
)
}
w.Flush()
e2elog.Logf("ClusterOperators:\n%s", buf.String())
e2e.Logf("ClusterOperators:\n%s", buf.String())
if len(unavailable) > 0 {
e2e.Failf("Some cluster operators never became available %s", strings.Join(unavailable, ", "))
}
Expand All @@ -190,13 +189,13 @@ func waitForOperatorsToSettle() {
}

func restartSDNPods(oc *exutil.CLI) {
e2elog.Logf("Restarting SDN")
e2e.Logf("Restarting SDN")

pods, err := oc.AdminKubeClient().CoreV1().Pods("openshift-sdn").List(context.Background(), metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())

for _, pod := range pods.Items {
e2elog.Logf("Deleting pod %s", pod.Name)
e2e.Logf("Deleting pod %s", pod.Name)
err := oc.AdminKubeClient().CoreV1().Pods("openshift-sdn").Delete(context.Background(), pod.Name, metav1.DeleteOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
}
Expand Down Expand Up @@ -255,7 +254,7 @@ func countReady(items []corev1.Node) int {
}

func fetchFileContents(node *corev1.Node, path string) string {
e2elog.Logf("Fetching %s file contents from %s", path, node.Name)
e2e.Logf("Fetching %s file contents from %s", path, node.Name)
out := execOnNodeWithOutputOrFail(node, fmt.Sprintf("cat %q", path))
return out.Stdout
}
Expand All @@ -271,7 +270,7 @@ func execOnNodeWithOutputOrFail(node *corev1.Node, cmd string) *e2essh.Result {
out, err = e2essh.IssueSSHCommandWithResult(cmd, e2e.TestContext.Provider, node)
// IssueSSHCommandWithResult logs output
if err != nil {
e2elog.Logf("Failed to exec cmd [%s] on node %s: %v", cmd, node.Name, err)
e2e.Logf("Failed to exec cmd [%s] on node %s: %v", cmd, node.Name, err)
}
return err == nil, nil
})
Expand Down
47 changes: 17 additions & 30 deletions test/extended/etcd/etcd_storage_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"),
gvr("storage.k8s.io", "v1alpha1", "csistoragecapacities"),
gvr("networking.k8s.io", "v1alpha1", "clustercidrs"),
gvr("resource.k8s.io", "v1alpha1", "resourceclasses"),
gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicybindings"),
gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"),
gvr("resource.k8s.io", "v1alpha1", "resourceclaimtemplates"),
gvr("resource.k8s.io", "v1alpha1", "resourceclaims"),
gvr("resource.k8s.io", "v1alpha1", "podschedulings"),
// disabled deprecated versions
gvr("autoscaling", "v2beta1", "horizontalpodautoscalers"),
gvr("batch", "v1beta1", "cronjobs"),
Expand All @@ -293,26 +299,19 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
gvr("node.k8s.io", "v1beta1", "runtimeclasses"),
gvr("policy", "v1beta1", "poddisruptionbudgets"),
gvr("policy", "v1beta1", "podsecuritypolicies"),
gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"),
)

// Apply output of git diff origin/release-1.XY origin/release-1.X(Y+1) test/integration/etcd/data.go. This is needed
// to apply the right data depending on the kube version of the running server. Replace this with the next current
// and rebase version next time. Don't pile them up.
if strings.HasPrefix(version.Minor, "26") {
if strings.HasPrefix(version.Minor, "27") {
for k, a := range map[schema.GroupVersionResource]etcddata.StorageData{
// Added etcd data.

// compare https://github.com/kubernetes/kubernetes/pull/112306
gvr("flowcontrol.apiserver.k8s.io", "v1beta3", "flowschemas"): {
Stub: `{"metadata": {"name": "fs-2"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
ExpectedEtcdPath: "/registry/flowschemas/fs-2",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta2", "FlowSchema"),
},
gvr("flowcontrol.apiserver.k8s.io", "v1beta3", "prioritylevelconfigurations"): {
Stub: `{"metadata": {"name": "conf4"}, "spec": {"type": "Limited", "limited": {"nominalConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf4",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta2", "PriorityLevelConfiguration"),
},
// TODO: When rebase has started, add etcd storage data has been added to
// k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.
} {
if _, preexisting := etcdStorageData[k]; preexisting {
t.Errorf("upstream etcd storage data already has data for %v. Update current and rebase version diff to next rebase version", k)
Expand All @@ -321,25 +320,13 @@ func testEtcd3StoragePath(t g.GinkgoTInterface, oc *exutil.CLI, etcdClient3Fn fu
}

// Modified etcd data.

// compare https://github.com/kubernetes/kubernetes/pull/112306
etcdStorageData[gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "flowschemas")] = etcddata.StorageData{
Stub: `{"metadata": {"name": "fs-1"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
ExpectedEtcdPath: "/registry/flowschemas/fs-1",
}
etcdStorageData[gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "prioritylevelconfigurations")] = etcddata.StorageData{
Stub: `{"metadata": {"name": "conf3"}, "spec": {"type": "Limited", "limited": {"assuredConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf3",
}
// TODO: When rebase has started, fixup etcd storage data that has been modified
// in k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.

// Removed etcd data.

// disabled deprecated versions in 1.26
removeStorageData(t, etcdStorageData,
gvr("autoscaling", "v2beta2", "horizontalpodautoscalers"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"),
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"),
)
// TODO: When rebase has started, remove etcd storage data that has been removed
// from k8s.io/kubernetes/test/integration/etcd/data.go in the 1.27 release.
removeStorageData(t, etcdStorageData)
}

// we use a different default path prefix for kube resources
Expand Down
12 changes: 4 additions & 8 deletions test/extended/idling/idling.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import (

kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
admissionapi "k8s.io/pod-security-admission/api"

e2e "k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
admissionapi "k8s.io/pod-security-admission/api"

unidlingapi "github.com/openshift/api/unidling/v1alpha1"

Expand Down Expand Up @@ -50,7 +49,7 @@ func tryEchoUDP(svc *kapiv1.Service, execPod *kapiv1.Pod) error {
cmd := fmt.Sprintf("echo -n \"echo %s\" | nc -w 5 -u %s %d", expected, rawIP, udpPort)

o.Eventually(func() (string, error) {
return e2e.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
return e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
}, 2*time.Minute, readTimeout).Should(o.Equal(expected))

return nil
Expand Down Expand Up @@ -79,7 +78,7 @@ func tryEchoHTTP(svc *kapiv1.Service, execPod *kapiv1.Pod) error {
net.JoinHostPort(rawIP, tcpPort),
url.QueryEscape(expected),
)
out, err := e2e.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
out, err := e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
if err != nil {
return fmt.Errorf("exec failed: %v\noutput: %s", err, out)
}
Expand Down Expand Up @@ -219,7 +218,6 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {
g.Describe("Idling", func() {
g.Context("with a single service and DeploymentConfig [apigroup:route.openshift.io]", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerFixture
})

Expand All @@ -230,7 +228,6 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {

g.Context("with a single service and ReplicationController", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerRcFixture
})

Expand All @@ -242,7 +239,6 @@ var _ = g.Describe("[sig-network-edge][Feature:Idling]", func() {

g.Describe("Unidling [apigroup:apps.openshift.io][apigroup:route.openshift.io]", func() {
g.BeforeEach(func() {
framework.BeforeEach()
fixture = echoServerFixture
})

Expand Down
3 changes: 2 additions & 1 deletion test/extended/images/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
admissionapi "k8s.io/pod-security-admission/api"

"github.com/openshift/api/image/docker10"
Expand Down Expand Up @@ -88,7 +89,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageAppend] Image append", func
registry := strings.Split(is.Status.DockerImageRepository, "/")[0]

ns = oc.Namespace()
cli := oc.KubeFramework().PodClient()
cli := e2epod.PodClientNS(oc.KubeFramework(), oc.Namespace())
pod := cli.Create(cliPodWithPullSecret(oc, heredoc.Docf(`
set -x

Expand Down
3 changes: 2 additions & 1 deletion test/extended/images/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

kapi "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
k8simage "k8s.io/kubernetes/test/utils/image"
admissionapi "k8s.io/pod-security-admission/api"

Expand Down Expand Up @@ -40,7 +41,7 @@ var _ = g.Describe("[sig-imageregistry][Feature:ImageExtract] Image extract", fu
registry := strings.Split(is.Status.DockerImageRepository, "/")[0]

ns = oc.Namespace()
cli := oc.KubeFramework().PodClient()
cli := e2epod.PodClientNS(oc.KubeFramework(), ns)
client := imageclientset.NewForConfigOrDie(oc.UserConfig()).ImageV1()

// import tools:latest into this namespace - working around a pull through bug with referenced docker images
Expand Down
Loading