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
13 changes: 13 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ COPY ./ ./

RUN go build -o /bin/openstack-test ./cmd/openshift-tests

# Test extension builder stage (added by ote-migration)
FROM golang:1.21 AS test-extension-builder
RUN mkdir -p /go/src/github.com/openshift/openstack-test
WORKDIR /go/src/github.com/openshift/openstack-test
COPY . .
RUN make tests-ext-build && \
cd bin && \
tar -czvf openstack-test-test-extension.tar.gz openstack-test-tests-ext && \
rm -f openstack-test-tests-ext

# Will be replaced in the CI with registry.ci.openshift.org/ocp/4.y:tools
FROM registry.access.redhat.com/ubi8/ubi

COPY --from=builder /bin/openstack-test /usr/bin/

# Copy test extension binary (added by ote-migration)
COPY --from=test-extension-builder /go/src/github.com/openshift/openstack-test/bin/openstack-test-test-extension.tar.gz /usr/bin/

USER 1000:1000
ENV LC_ALL en_US.UTF-8

Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@ verify:
run: openstack-tests
./$< run openshift/openstack
.PHONY: run

# OTE test extension binary configuration
TESTS_EXT_BINARY := bin/openstack-test-tests-ext

.PHONY: tests-ext-build
tests-ext-build:
@echo "Building OTE test extension binary..."
@mkdir -p bin
GOTOOLCHAIN=auto GOSUMDB=sum.golang.org go build -mod=vendor -o $(TESTS_EXT_BINARY) ./cmd/extension
@echo "Extension binary built: $(TESTS_EXT_BINARY)"

.PHONY: extension
extension: tests-ext-build

.PHONY: clean-extension
clean-extension:
@echo "Cleaning extension binary..."
@rm -f $(TESTS_EXT_BINARY)
139 changes: 139 additions & 0 deletions cmd/extension/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package main

import (
"flag"
"fmt"
"os"
"regexp"
"strings"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/component-base/logs"

"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
e "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
"github.com/openshift/origin/test/extended/util"
framework "k8s.io/kubernetes/test/e2e/framework"

_ "github.com/openshift/openstack-test/test/extended/openstack"
)

func main() {
pflag.CommandLine = pflag.NewFlagSet("empty", pflag.ExitOnError)
flag.CommandLine = flag.NewFlagSet("empty", flag.ExitOnError)
util.InitStandardFlags()
framework.AfterReadingAllFlags(&framework.TestContext)

logs.InitLogs()
defer logs.FlushLogs()

registry := e.NewRegistry()
ext := e.NewExtension("openshift", "payload", "openstack-test")

registerSuites(ext)

allSpecs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
if err != nil {
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
}

componentSpecs := allSpecs.Select(func(spec *et.ExtensionTestSpec) bool {
for _, loc := range spec.CodeLocations {
if strings.Contains(loc, "/test/extended/openstack/") && !strings.Contains(loc, "/go/pkg/mod/") && !strings.Contains(loc, "/vendor/") {
return true
}
}
return false
})

componentSpecs.AddBeforeAll(func() {
if err := util.InitTest(false); err != nil {
panic(err)
}
util.WithCleanup(func() {})
})

componentSpecs.Walk(func(spec *et.ExtensionTestSpec) {
for label := range spec.Labels {
if strings.HasPrefix(label, "Platform:") {
platformName := strings.TrimPrefix(label, "Platform:")
spec.Include(et.PlatformEquals(platformName))
}
}

re := regexp.MustCompile(`\[platform:([a-z]+)\]`)
if match := re.FindStringSubmatch(spec.Name); match != nil {
platform := match[1]
spec.Include(et.PlatformEquals(platform))
}

spec.Lifecycle = et.LifecycleInforming
})

ext.AddSpecs(componentSpecs)

registry.Register(ext)

root := &cobra.Command{
Long: "Openstack-test Tests",
}

root.AddCommand(cmd.DefaultExtensionCommands(registry)...)

if err := func() error {
return root.Execute()
}(); err != nil {
os.Exit(1)
}
}

func registerSuites(ext *e.Extension) {
suites := []e.Suite{
{
Name: "openstack-test/conformance/parallel",
Parents: []string{
"openshift/conformance/parallel",
},
Description: "Parallel conformance tests (Level0, non-serial, non-disruptive)",
Qualifiers: []string{
`name.contains("[Level0]") && !(name.contains("[Serial]") || name.contains("[Disruptive]"))`,
},
},
{
Name: "openstack-test/conformance/serial",
Parents: []string{
"openshift/conformance/serial",
},
Description: "Serial conformance tests (must run sequentially)",
Qualifiers: []string{
`name.contains("[Level0]") && name.contains("[Serial]") && !name.contains("[Disruptive]")`,
},
},
{
Name: "openstack-test/disruptive",
Parents: []string{"openshift/disruptive"},
Description: "Disruptive tests (may affect cluster state)",
Qualifiers: []string{
`name.contains("[Disruptive]")`,
},
},
{
Name: "openstack-test/non-disruptive",
Description: "All non-disruptive tests (safe for development clusters)",
Qualifiers: []string{
`!name.contains("[Disruptive]")`,
},
},
{
Name: "openstack-test/all",
Description: "All openstack-test tests",
},
}

for _, suite := range suites {
ext.AddSuite(suite)
}
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/gophercloud/gophercloud/v2 v2.7.0
github.com/onsi/ginkgo/v2 v2.22.2
github.com/onsi/gomega v1.36.2
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260422120742-50dec0b5ecf3
github.com/openshift/api v0.0.0-20250513132935-9052dea86694
github.com/openshift/client-go v0.0.0-20250513150353-9ea84fa6431b
github.com/openshift/cluster-api-actuator-pkg v0.0.0-20250401133953-e7e157c4c1fe
Expand Down Expand Up @@ -324,6 +325,7 @@ replace (
k8s.io/dynamic-resource-allocation => github.com/openshift/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v0.0.0-20250527023356-4cd5657aac98
k8s.io/endpointslice => github.com/openshift/kubernetes/staging/src/k8s.io/endpointslice v0.0.0-20250527023356-4cd5657aac98
k8s.io/externaljwt => github.com/openshift/kubernetes/staging/src/k8s.io/externaljwt v0.0.0-20250527023356-4cd5657aac98
k8s.io/kms => github.com/openshift/kubernetes/staging/src/k8s.io/kms v0.0.0-20250527023356-4cd5657aac98
k8s.io/kube-aggregator => github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20250527023356-4cd5657aac98
k8s.io/kube-controller-manager => github.com/openshift/kubernetes/staging/src/k8s.io/kube-controller-manager v0.0.0-20250527023356-4cd5657aac98
k8s.io/kube-proxy => github.com/openshift/kubernetes/staging/src/k8s.io/kube-proxy v0.0.0-20250527023356-4cd5657aac98
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jDMcgULaH8=
github.com/opencontainers/selinux v1.11.1/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250220212757-b9c4d98a0c45 h1:hXpbYtP3iTh8oy/RKwKkcMziwchY3fIk95ciczf7cOA=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250220212757-b9c4d98a0c45/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260422120742-50dec0b5ecf3 h1:8DsrRTrsWWFU89XhpZJVhPzAk32/rxtHhw8+kELNVRo=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260422120742-50dec0b5ecf3/go.mod h1:pHOS9c6BjZv91OkkHyIHAOWnYhxwcxWQkyYGEvPyUCE=
github.com/openshift/api v0.0.0-20250513132935-9052dea86694 h1:kPnk1+m89LJHexYsTP+MVM9OgJLxcpUR3vRdMQNF66s=
github.com/openshift/api v0.0.0-20250513132935-9052dea86694/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/openshift/apiserver-library-go v0.0.0-20250127121756-dc9a973f14ce h1:w0Up6YV1APcn20v/1h5IfuToz96o2pVqZyjzbw0yotU=
Expand Down Expand Up @@ -476,6 +476,8 @@ github.com/openshift/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v
github.com/openshift/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v0.0.0-20250527023356-4cd5657aac98/go.mod h1:lHc2r9QqTP5jQ/qzHRjEjvq+P2pMIJxH3pW2OIeKGm4=
github.com/openshift/kubernetes/staging/src/k8s.io/externaljwt v0.0.0-20250527023356-4cd5657aac98 h1:UCG7qLSuT0WhLVFrhmeOD6lhTQJsGKQEoVYz22GOyxc=
github.com/openshift/kubernetes/staging/src/k8s.io/externaljwt v0.0.0-20250527023356-4cd5657aac98/go.mod h1:cYoh1BjUit+0mmm1QFiHHIvFRp5NuJ/PtXFjqU6lG2I=
github.com/openshift/kubernetes/staging/src/k8s.io/kms v0.0.0-20250527023356-4cd5657aac98 h1:JLBBDOj3UuSLVqZfN+m6woQlSty9ITVhMIHLr61NVPc=
github.com/openshift/kubernetes/staging/src/k8s.io/kms v0.0.0-20250527023356-4cd5657aac98/go.mod h1:WwxOP90Kv6tPghVc5qa01Rt3aX5eU5SQMUJ8duaa6tE=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20250527023356-4cd5657aac98 h1:tWb8KZY4OHiKobRp6hhc37V+kv8rClXjexhTn+2RxS8=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-aggregator v0.0.0-20250527023356-4cd5657aac98/go.mod h1:0G+pIl5ZSz2OJTbaNrYgYDas3AAuLuyb6f7yp67vUc0=
github.com/openshift/kubernetes/staging/src/k8s.io/kube-scheduler v0.0.0-20250527023356-4cd5657aac98 h1:GiO9lU3FaQdI2jYW8My1ZN/ZRcNdfekuK7EgCUO1+H8=
Expand Down Expand Up @@ -836,8 +838,6 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kms v0.32.1 h1:TW6cswRI/fawoQRFGWLmEceO37rZXupdoRdmO019jCc=
k8s.io/kms v0.32.1/go.mod h1:Bk2evz/Yvk0oVrvm4MvZbgq8BD34Ksxs2SRHn4/UiOM=
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/bz_2022627.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] Bugfix", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] Bugfix", func() {
defer g.GinkgoRecover()

// returns the list of addresses
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/bz_2073398.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/gophercloud/gophercloud/v2/openstack/networking/v2/subnets"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] Bugfix", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] Bugfix", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/cloud-provider-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
e2e "k8s.io/kubernetes/test/e2e/framework"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] The Openshift", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] The Openshift", func() {
defer g.GinkgoRecover()

var err error
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/cpms.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] ControlPlane MachineSet", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] ControlPlane MachineSet", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/dualstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack][lb][Serial] The Openstack platform", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack][lb][Serial] The Openstack platform", func() {
oc := exutil.NewCLI("openstack")
var loadBalancerClient *gophercloud.ServiceClient
var networkClient *gophercloud.ServiceClient
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/egressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
egressAssignableLabelKey = "k8s.ovn.org/egress-assignable"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack][egressip] An egressIP", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack][egressip] An egressIP", func() {
var networkClient *gophercloud.ServiceClient
var clientSet *kubernetes.Clientset
var err error
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/kuryr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack][Kuryr] Kuryr", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack][Kuryr] Kuryr", func() {
var clientSet *kubernetes.Clientset

g.BeforeEach(func(ctx g.SpecContext) {
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack][lb][Serial] The Openstack platform", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack][lb][Serial] The Openstack platform", func() {
oc := exutil.NewCLI("openstack")
var loadBalancerClient *gophercloud.ServiceClient
var networkClient *gophercloud.ServiceClient
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/local-bd-etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] The OpenShift cluster", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] The OpenShift cluster", func() {
defer g.GinkgoRecover()

const minEtcdDiskSizeGiB = 10
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/gophercloud/gophercloud/v2/openstack/networking/v2/networks"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] Machine", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] Machine", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/machineset.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
machineSetOwningLabel = "machine.openshift.io/cluster-api-machineset"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] MachineSet", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] MachineSet", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const (
)`
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] Check shift-on-stack", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] Check shift-on-stack", func() {

defer g.GinkgoRecover()

Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/ocpbug_1765.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] Bugfix", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] Bugfix", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/servergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] The OpenStack platform", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] The OpenStack platform", func() {
defer g.GinkgoRecover()

var computeClient *gophercloud.ServiceClient
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] The OpenShift cluster", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] The OpenShift cluster", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
2 changes: 1 addition & 1 deletion test/extended/openstack/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
)

var _ = g.Describe("[sig-installer][Suite:openshift/openstack] The OpenStack platform", func() {
var _ = g.Describe("[OTP][sig-installer][Suite:openshift/openstack] The OpenStack platform", func() {
defer g.GinkgoRecover()

var dc dynamic.Interface
Expand Down
Loading