@@ -8,6 +8,10 @@ function os::test::extended::focus () {
8
8
os::log::fatal " the --ginkgo.focus flag is no longer supported, use FOCUS=foo <suite.sh> instead."
9
9
exit 1
10
10
fi
11
+ if [[ " $@ [@]" =~ " -suite" ]]; then
12
+ os::log::fatal " the -suite flag is no longer supported, use SUITE=foo instead."
13
+ exit 1
14
+ fi
11
15
if [[ -n " ${FOCUS:- } " ]]; then
12
16
exitstatus=0
13
17
@@ -56,104 +60,13 @@ function os::test::extended::setup () {
56
60
function cleanup() {
57
61
return_code=$?
58
62
os::test::junit::generate_report
59
- os::cleanup::all
60
63
os::util::describe_return_code " ${return_code} "
61
64
exit " ${return_code} "
62
65
}
63
66
trap " cleanup" EXIT
64
67
65
- if [[ -n " ${TEST_ONLY-} " ]]; then
66
- os::log::info " Running tests against existing cluster..."
67
- return 0
68
- fi
69
-
70
- os::util::ensure::built_binary_exists ' openshift'
71
-
72
- os::util::environment::use_sudo
73
- os::cleanup::tmpdir
74
- os::util::environment::setup_all_server_vars
75
- os::util::ensure::iptables_privileges_exist
76
-
77
- os::log::info " Starting server"
78
-
79
- os::util::environment::setup_images_vars
80
-
81
- local sudo=${USE_SUDO: +sudo}
82
-
83
- # If the current system has the XFS volume dir mount point we configure
84
- # in the test images, assume to use it which will allow the local storage
85
- # quota tests to pass.
86
- LOCAL_STORAGE_QUOTA=" "
87
- if [[ -d " /mnt/openshift-xfs-vol-dir" ]] && ${sudo} lvs | grep -q " xfs" ; then
88
- LOCAL_STORAGE_QUOTA=" 1"
89
- export VOLUME_DIR=" /mnt/openshift-xfs-vol-dir"
90
- else
91
- os::log::warning " /mnt/openshift-xfs-vol-dir does not exist, local storage quota tests may fail."
92
- fi
93
-
94
- os::log::system::start
95
-
96
- if [[ -n " ${SHOW_ALL:- } " ]]; then
97
- SKIP_NODE=1
98
- fi
99
-
100
- # make sure the volume dir has the same label as we would apply to the default VOLUME_DIR
101
- if selinuxenabled; then
102
- local label=$( matchpathcon -n -m dir /var/lib/openshift/openshift.local.volumes)
103
- ${sudo} chcon " ${label} " ${VOLUME_DIR}
104
- fi
105
- CONFIG_VERSION=" "
106
- if [[ -n " ${API_SERVER_VERSION:- } " ]]; then
107
- CONFIG_VERSION=" ${API_SERVER_VERSION} "
108
- elif [[ -n " ${CONTROLLER_VERSION:- } " ]]; then
109
- CONFIG_VERSION=" ${CONTROLLER_VERSION} "
110
- fi
111
- os::start::configure_server " ${CONFIG_VERSION} "
112
- # turn on audit logging for extended tests ... mimic what is done in os::start::configure_server, but don't
113
- # put change there - only want this for extended tests
114
- os::log::info " Turn on audit logging"
115
- cp " ${SERVER_CONFIG_DIR} /master/master-config.yaml" " ${SERVER_CONFIG_DIR} /master/master-config.orig2.yaml"
116
- oc patch --local --type=json -o yaml -f " ${SERVER_CONFIG_DIR} /master/master-config.orig2.yaml" --patch=" [{\" op\" : \" replace\" , \" path\" : \" /auditConfig/enabled\" , \" value\" : true}, {\" op\" : \" replace\" , \" path\" : \" /auditConfig/auditFilePath\" , \" value\" : \" ${LOG_DIR} /audit.log\" }]" > " ${SERVER_CONFIG_DIR} /master/master-config.yaml"
117
-
118
- cp " ${SERVER_CONFIG_DIR} /master/master-config.yaml" " ${SERVER_CONFIG_DIR} /master/master-config.orig2.yaml"
119
- oc patch --local --type=json -o yaml -f " ${SERVER_CONFIG_DIR} /master/master-config.orig2.yaml" --patch=" [{\" op\" : \" add\" , \" path\" : \" /templateServiceBrokerConfig\" , \" value\" : {\" templaceNamespaces\" : [\" openshift\" ]}}]" > " ${SERVER_CONFIG_DIR} /master/master-config.yaml"
120
-
121
- # If the XFS volume dir mount point exists enable local storage quota in node-config.yaml so these tests can pass:
122
- if [[ -n " ${LOCAL_STORAGE_QUOTA} " ]]; then
123
- # The ec2 images usually have ~5Gi of space defined for the xfs vol for the registry; want to give /registry a good chunk of that
124
- # to store the images created when the extended tests run
125
- cp " ${NODE_CONFIG_DIR} /node-config.yaml" " ${NODE_CONFIG_DIR} /node-config.orig2.yaml"
126
- oc patch --local --type=json -o yaml -f " ${NODE_CONFIG_DIR} /node-config.orig2.yaml" --patch=" [{\" op\" : \" add\" , \" path\" : \" /volumeConfig/localQuota\" , \" value\" : {\" perFSGroup\" : \" 4480Mi\" }}]" > " ${NODE_CONFIG_DIR} /node-config.yaml"
127
- fi
128
- os::log::info " Using VOLUME_DIR=${VOLUME_DIR} "
129
-
130
- # This is a bit hacky, but set the pod gc threshold appropriately for the garbage_collector test
131
- # and enable-hostpath-provisioner for StatefulSet tests
132
- cp " ${SERVER_CONFIG_DIR} /master/master-config.yaml" " ${SERVER_CONFIG_DIR} /master/master-config.orig3.yaml"
133
- oc patch --local --type=json -o yaml -f " ${SERVER_CONFIG_DIR} /master/master-config.orig3.yaml" --patch=" [{\" op\" : \" add\" , \" path\" : \" /kubernetesMasterConfig/controllerArguments\" , \" value\" : {\" terminated-pod-gc-threshold\" :[\" 100\" ], \" enable-hostpath-provisioner\" :[\" true\" ]}}]" > " ${SERVER_CONFIG_DIR} /master/master-config.yaml"
134
-
135
- os::start::server " ${API_SERVER_VERSION:- } " " ${CONTROLLER_VERSION:- } " " ${SKIP_NODE:- } "
136
-
137
- export KUBECONFIG=" ${ADMIN_KUBECONFIG} "
138
-
139
- os::start::registry
140
- if [[ -z " ${SKIP_NODE:- } " ]]; then
141
- oc rollout status dc/docker-registry
142
- fi
143
- CREATE_ROUTER_CERT=true os::start::router
144
-
145
- os::log::info " Creating image streams"
146
- oc create -n openshift -f " ${OS_ROOT} /examples/image-streams/image-streams-centos7.json" --config=" ${ADMIN_KUBECONFIG} "
147
-
148
- os::log::info " Creating quickstart templates"
149
- oc create -n openshift -f " ${OS_ROOT} /examples/quickstarts" --config=" ${ADMIN_KUBECONFIG} "
150
-
151
- os::log::info " Creating db-templates templates"
152
- oc create -n openshift -f " ${OS_ROOT} /examples/db-templates" --config=" ${ADMIN_KUBECONFIG} "
153
-
154
- os::log::info " Creating jenkins templates"
155
- oc create -n openshift -f " ${OS_ROOT} /examples/jenkins/jenkins-ephemeral-template.json" --config=" ${ADMIN_KUBECONFIG} "
156
-
68
+ os::log::info " Running tests against existing cluster..."
69
+ return 0
157
70
}
158
71
159
72
# Run extended tests or print out a list of tests that need to be run
@@ -172,6 +85,9 @@ function os::test::extended::run () {
172
85
if [[ -n " ${FOCUS-} " ]]; then
173
86
listArgs+=(" --ginkgo.focus=${FOCUS} " )
174
87
runArgs+=(" -focus=${FOCUS} " )
88
+ elif [[ -n " ${SUITE-} " ]]; then
89
+ listArgs+=(" --ginkgo.focus=${SUITE} " )
90
+ runArgs+=(" -focus=${SUITE} " )
175
91
fi
176
92
177
93
local skip=" ${SKIP-} "
0 commit comments