diff --git a/Makefile b/Makefile index e175d6b..9ce37cf 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ SHELL = /bin/bash .PHONY: acceptance -acceptance: +acceptance: ensure-cluster-setup @scripts/acceptance.sh +ensure-cluster-setup: + @scripts/ensure-cluster-setup.sh + .PHONY: github-actions-ci github-actions-ci: @scripts/github-actions-ci.sh diff --git a/lib/Kubectl.py b/lib/Kubectl.py index ca0ead5..ceb2a4a 100644 --- a/lib/Kubectl.py +++ b/lib/Kubectl.py @@ -18,4 +18,9 @@ def pods_with_prefix_are_running(self, namespace, pod_prefix, num_expected): cmd = '[ `kubectl get pods --namespace='+namespace cmd += ' | grep ^'+pod_prefix+' | awk \'{print $2 "--" $3}\'' cmd += ' | grep -E "^([1-9][0-9]*)/\\1--Running" | wc -l` == '+num_expected+' ]' - self.run_command(kind_auth_wrap(cmd)) \ No newline at end of file + self.run_command(kind_auth_wrap(cmd)) + + def deamon_set_pods_with_prefix(self, namespace,pod_prefix): + cmd = 'kubectl get nodes | grep Ready | wc -l' + self.run_command(kind_auth_wrap(cmd)) + self.pods_with_prefix_are_running(namespace, pod_prefix, self.stdout) \ No newline at end of file diff --git a/scripts/ensure-cluster-setup.sh b/scripts/ensure-cluster-setup.sh new file mode 100755 index 0000000..5c032b0 --- /dev/null +++ b/scripts/ensure-cluster-setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash -e +# +# Copyright The Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Create a persistance volume with standard storageclass +cat <