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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions test/extended/apiserver/api_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
apiserverv1 "github.com/openshift/api/apiserver/v1"
configv1 "github.com/openshift/api/config/v1"
apiserverclientv1 "github.com/openshift/client-go/apiserver/clientset/versioned/typed/apiserver/v1"
configclient "github.com/openshift/client-go/config/clientset/versioned"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
Expand Down Expand Up @@ -96,13 +95,7 @@ var _ = g.Describe("[sig-arch][Late]", func() {
apirequestCountClient, err := apiserverclientv1.NewForConfig(oc.AdminConfig())
o.Expect(err).NotTo(o.HaveOccurred())

clientConfig, err := framework.LoadConfig(true)
o.Expect(err).NotTo(o.HaveOccurred())

configClient, err := configclient.NewForConfig(clientConfig)
o.Expect(err).NotTo(o.HaveOccurred())

infra, err := configClient.ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())

type platformUpperBound map[string]int64
Expand Down
2 changes: 1 addition & 1 deletion test/extended/cli/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
oc.Run("delete").Args("-f", "-").InputString(policyClusterRoles).Execute()
})

g.It("role-selectors", func() {
g.It("role-selectors [apigroup:template.openshift.io]", func() {
clusterRole := gen.GenerateName("basic-user2-")
clusterBinding := gen.GenerateName("basic-users2-")
// template processing requires a namespaced client
Expand Down
55 changes: 41 additions & 14 deletions test/extended/cli/apiresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,12 @@ var _ = g.Describe("[sig-cli] oc api-resources", func() {
out, err := oc.Run("api-resources").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("configmaps"))
o.Expect(out).To(o.ContainSubstring("images"))
o.Expect(out).To(o.ContainSubstring("imagestreamtags"))
o.Expect(out).To(o.ContainSubstring("jobs"))
o.Expect(out).To(o.ContainSubstring("nodes"))
o.Expect(out).To(o.ContainSubstring("pods"))
o.Expect(out).To(o.ContainSubstring("secrets"))
o.Expect(out).To(o.ContainSubstring("services"))

out, err = oc.Run("api-resources").Args("--api-group=build.openshift.io").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("builds"))
o.Expect(out).To(o.ContainSubstring("buildconfigs"))

out, err = oc.Run("api-resources").Args("--namespaced=false").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("clusterroles"))
Expand All @@ -41,19 +34,53 @@ var _ = g.Describe("[sig-cli] oc api-resources", func() {
o.Expect(out).To(o.ContainSubstring("serviceaccounts"))
o.Expect(out).To(o.ContainSubstring("deployments"))

out, err = oc.Run("api-resources").Args("--verbs=get").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("configs"))
o.Expect(out).To(o.ContainSubstring("routes"))
o.Expect(out).To(o.ContainSubstring("volumesnapshots"))

out, err = oc.Run("api-versions").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("apps/v1"))
o.Expect(out).To(o.ContainSubstring("networking.k8s.io/v1"))
o.Expect(out).To(o.ContainSubstring("node.k8s.io/v1"))
o.Expect(out).To(o.ContainSubstring("storage.k8s.io/v1"))
})

g.It("can output expected information about build.openshift.io api-resources [apigroup:build.openshift.io]", func() {
out, err := oc.Run("api-resources").Args("--api-group=build.openshift.io").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("builds"))
o.Expect(out).To(o.ContainSubstring("buildconfigs"))
})

g.It("can output expected information about image.openshift.io api-resources [apigroup:image.openshift.io]", func() {
out, err := oc.Run("api-resources").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("images"))
o.Expect(out).To(o.ContainSubstring("imagestreamtags"))
})

g.It("can output expected information about operator.openshift.io api-resources [apigroup:operator.openshift.io]", func() {
out, err := oc.Run("api-resources").Args("--verbs=get").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("configs"))
})

g.It("can output expected information about project.openshift.io api-resources [apigroup:project.openshift.io]", func() {
out, err := oc.Run("api-versions").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("project.openshift.io/v1"))
})

g.It("can output expected information about route.openshift.io api-resources and api-version [apigroup:route.openshift.io]", func() {
out, err := oc.Run("api-resources").Args("--verbs=get").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("routes"))

out, err = oc.Run("api-versions").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("route.openshift.io/v1"))
o.Expect(out).To(o.ContainSubstring("storage.k8s.io/v1"))
})

g.It("can output expected information about snapshot.storage.k8s.io api-resources [apigroup:snapshot.storage.k8s.io]", func() {
out, err := oc.Run("api-resources").Args("--verbs=get").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("volumesnapshots"))
})
})
8 changes: 4 additions & 4 deletions test/extended/cli/basics.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = g.Describe("[sig-cli] oc basics", func() {
o.Expect(err).NotTo(o.HaveOccurred())
})

g.It("can create deploymentconfig and clusterquota", func() {
g.It("can create deploymentconfig and clusterquota [apigroup:apps.openshift.io]", func() {
nginx := k8simage.GetE2EImage(k8simage.Nginx)
tools := "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest"

Expand Down Expand Up @@ -101,7 +101,7 @@ var _ = g.Describe("[sig-cli] oc basics", func() {
o.Expect(err).NotTo(o.HaveOccurred())
})

g.It("can patch resources", func() {
g.It("can patch resources [apigroup:user.openshift.io]", func() {
// need admin here
ocAdmin := oc.AsAdmin()

Expand Down Expand Up @@ -136,7 +136,7 @@ var _ = g.Describe("[sig-cli] oc basics", func() {
o.Expect(err).NotTo(o.HaveOccurred())
})

g.It("can describe an OAuth access token", func() {
g.It("can describe an OAuth access token [apigroup:oauth.openshift.io]", func() {
// need admin here
ocAdmin := oc.AsAdmin()

Expand Down Expand Up @@ -165,7 +165,7 @@ var _ = g.Describe("[sig-cli] oc basics", func() {
o.Expect(out).To(o.ContainSubstring("job.batch/foo"))
})

g.It("can process templates", func() {
g.It("can process templates [apigroup:template.openshift.io]", func() {
name := filepath.Join(os.TempDir(), "template.json")

out, err := oc.Run("process").Args("-f", templateFile, "-l", "name=mytemplate").Output()
Expand Down
4 changes: 2 additions & 2 deletions test/extended/cli/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var _ = g.Describe("[sig-cli] oc", func() {

oc = exutil.NewCLIWithPodSecurityLevel("cli", admissionapi.LevelBaseline)

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

_, err := oc.KubeClient().RbacV1().RoleBindings(ns).Create(context.Background(), &rbacv1.RoleBinding{
Expand Down
Loading