Skip to content

Commit

Permalink
Move the golden images test to golang (kubevirt#2427)
Browse files Browse the repository at this point in the history
Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
  • Loading branch information
nunnatsa authored Jul 10, 2023
1 parent 1bbdfa3 commit 2e339b9
Show file tree
Hide file tree
Showing 32 changed files with 15,657 additions and 207 deletions.
62 changes: 0 additions & 62 deletions hack/check_golden_images.sh

This file was deleted.

3 changes: 0 additions & 3 deletions hack/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ ${KUBECTL_BINARY} get hco -n "${INSTALLED_NAMESPACE}" kubevirt-hyperconverged -o
# wait a bit to make sure the VMs are deleted
sleep 60

# Check golden images
KUBECTL_BINARY=${KUBECTL_BINARY} ./hack/check_golden_images.sh

# Check TLS profile on the webhook
KUBECTL_BINARY=${KUBECTL_BINARY} ./hack/check_tlsprofile.sh

Expand Down
3 changes: 0 additions & 3 deletions hack/upgrade-test-index-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,6 @@ else
echo "TTO reference removed from .status.relatedObjects"
fi

Msg "check golden images"
KUBECTL_BINARY=${CMD} INSTALLED_NAMESPACE=${HCO_NAMESPACE} ./hack/check_golden_images.sh

Msg "check virtio-win image is in configmap"
VIRTIOWIN_IMAGE_CSV=$(${CMD} get ${CSV} -n ${HCO_NAMESPACE} \
-o jsonpath='{.spec.install.spec.deployments[?(@.name=="hco-operator")].spec.template.spec.containers[0].env[?(@.name=="VIRTIOWIN_CONTAINER")].value}')
Expand Down
3 changes: 0 additions & 3 deletions hack/upgrade-test-operator-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,6 @@ else
echo "TTO reference removed from .status.relatedObjects"
fi

Msg "check golden images"
KUBECTL_BINARY=${CMD} INSTALLED_NAMESPACE=${HCO_NAMESPACE} ./hack/check_golden_images.sh

Msg "check virtio-win image is in configmap"
VIRTIOWIN_IMAGE_CSV=$(${CMD} get ${CSV} -n ${HCO_NAMESPACE} \
-o jsonpath='{.spec.install.spec.deployments[?(@.name=="hco-operator")].spec.template.spec.containers[0].env[?(@.name=="VIRTIOWIN_CONTAINER")].value}')
Expand Down
18 changes: 12 additions & 6 deletions tests/func-tests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"sync"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

const (
Expand Down Expand Up @@ -37,9 +37,15 @@ type DashboardTestConfig struct {
TestItems []DashboardTestItem `yaml:"testItems,omitempty"`
}

type DataImportCronConfig struct {
ExpectedDataImportCrons []string `yaml:"expectedDataImportCrons,omitempty"`
Namespace string `yaml:"namespace,omitempty"`
}

type TestConfig struct {
QuickStart QuickStartTestConfig `yaml:"quickStart,omitempty"`
Dashboard DashboardTestConfig `yaml:"dashboard,omitempty"`
QuickStart QuickStartTestConfig `yaml:"quickStart,omitempty"`
Dashboard DashboardTestConfig `yaml:"dashboard,omitempty"`
DataImportCron DataImportCronConfig `yaml:"dataImportCron,omitempty"`
}

func init() {
Expand All @@ -56,19 +62,19 @@ func GetConfig() *TestConfig {
}

func loadConfig(fileName string) *TestConfig {
config := TestConfig{}
cfg := TestConfig{}

if fileName != "" {
file, err := os.Open(fileName)
if err != nil {
panic(err)
}
dec := yaml.NewDecoder(file)
err = dec.Decode(&config)
err = dec.Decode(&cfg)
if err != nil {
panic(err)
}
}

return &config
return &cfg
}
128 changes: 0 additions & 128 deletions tests/func-tests/dict_test.go

This file was deleted.

Loading

0 comments on commit 2e339b9

Please sign in to comment.