From e47d55e9c210ee5fcddb572f67bd92b617712b70 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 23 Jul 2020 21:14:08 -0500 Subject: [PATCH 1/2] creating cowsay kuttl tests Signed-off-by: Ken Sipe --- .../tests/cowsay-config-map/00-assert.yaml | 9 +++++++++ .../tests/cowsay-config-map/01-assert.yaml | 20 +++++++++++++++++++ .../cowsay-config-map/01-install-cowsay.yaml | 4 ++++ .../tests/cowsay-config-map/02-assert.yaml | 15 ++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 repository/cowsay/tests/cowsay-config-map/00-assert.yaml create mode 100644 repository/cowsay/tests/cowsay-config-map/01-assert.yaml create mode 100644 repository/cowsay/tests/cowsay-config-map/01-install-cowsay.yaml create mode 100644 repository/cowsay/tests/cowsay-config-map/02-assert.yaml diff --git a/repository/cowsay/tests/cowsay-config-map/00-assert.yaml b/repository/cowsay/tests/cowsay-config-map/00-assert.yaml new file mode 100644 index 0000000..e351c98 --- /dev/null +++ b/repository/cowsay/tests/cowsay-config-map/00-assert.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Pod +metadata: + name: kudo-controller-manager-0 + namespace: kudo-system +status: + phase: Running + +# confirms that kudo is running diff --git a/repository/cowsay/tests/cowsay-config-map/01-assert.yaml b/repository/cowsay/tests/cowsay-config-map/01-assert.yaml new file mode 100644 index 0000000..bb68c11 --- /dev/null +++ b/repository/cowsay/tests/cowsay-config-map/01-assert.yaml @@ -0,0 +1,20 @@ +apiVersion: kudo.dev/v1beta1 +kind: Instance +metadata: + labels: + kudo.dev/operator: cowsay + name: cowsay-instance + namespace: default +status: + planStatus: + deploy: + name: deploy + phases: + - name: main + status: COMPLETE + steps: + - name: genfiles + status: COMPLETE + - name: app + status: COMPLETE + status: COMPLETE diff --git a/repository/cowsay/tests/cowsay-config-map/01-install-cowsay.yaml b/repository/cowsay/tests/cowsay-config-map/01-install-cowsay.yaml new file mode 100644 index 0000000..47e8997 --- /dev/null +++ b/repository/cowsay/tests/cowsay-config-map/01-install-cowsay.yaml @@ -0,0 +1,4 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - command: kubectl kudo install ../../operator \ No newline at end of file diff --git a/repository/cowsay/tests/cowsay-config-map/02-assert.yaml b/repository/cowsay/tests/cowsay-config-map/02-assert.yaml new file mode 100644 index 0000000..221143c --- /dev/null +++ b/repository/cowsay/tests/cowsay-config-map/02-assert.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +binaryData: + index.html: PGh0bWw+CjxoZWFkPgogIDx0aXRsZT5UaGUgY293IHNheXMgIkdvb2QgdGhpbmdzIGNvbWUgd2hlbiB5b3UuLi4iPC90aXRsZT4KICA8bWV0YSBuYW1lPSJkZXNjcmlwdGlvbiIgY29udGVudD0iY293c2F5IE9ubGluZSBpcyBhIHdlYi1lbmFibGVkIGNvd3NheSBhbmQgQVBJIHByb3ZpZGluZyBhbGwgb2YgeW91ciBvbmxpbmUgY293c2F5aW5nIG5lZWRzLiIgLz4KICA8bWV0YSBwcm9wZXJ0eT0ib2c6aW1hZ2UiIGNvbnRlbnQ9Imh0dHA6Ly9jb3dzYXkubW9yZWNvZGUub3JnL3N0YXRpYy9jb3dzYXkucG5nIiAvPgogIDxtZXRhIGNvbnRlbnQ9IjEwMTMwOTQiIHByb3BlcnR5PSJmYjphZG1pbnMiIC8+IAoKICA8c3R5bGU+CiAgICBib2R5LCBpbnB1dCB7CiAgICAgIGZvbnQtZmFtaWx5OiBoZWx2ZXRpY2E7CiAgICAgIGZvbnQtc2l6ZTogMTJweDsKICAgIH0KCiAgICBoMSB7CiAgICAgIGZvbnQtc2l6ZTogMTRweDsKICAgIH0KCiAgICBmb3JtIGxhYmVsIHsKICAgICAgZGlzcGxheTogYmxvY2s7CiAgICB9CgogICAgZm9ybSB0ZXh0YXJlYSB7CiAgICAgIHdpZHRoOiA0NTBweDsKCSAgaGVpZ2h0OiA4MHB4OwogICAgfQoKICAgIC5lcnJvciB7CiAgICAgIGNvbG9yOiAjZjAwOwogICAgICBmb250LXdlaWdodDogYm9sZDsKICAgIH0KCiAgICAuZm9vdGVyIHsKICAgICAgYm9yZGVyLXRvcDogMXB4IHNvbGlkICNjY2M7CiAgICAgIGZvbnQtc2l6ZTogMTFweDsKICAgICAgcGFkZGluZy10b3A6IDVweDsKICAgIH0KCiAgICAuYWRkdGhpc190b29sYm94IHsKICAgICAgbWFyZ2luLWJvdHRvbTogMTBweDsKICAgIH0KCiAgICBwcmUuY293IHsKICAgICAgZm9udC1zaXplOiAxOHB4OwogICAgICBtYXJnaW4tbGVmdDogNDBweDsKICAgIH0KCiAgPC9zdHlsZT4KPC9oZWFkPgo8Ym9keT4KPGgxPjxhIGhyZWY9Ii4vIj5NT08hPC9hPjwvaDE+Cgo8cHJlIGNsYXNzPSJjb3ciPgogIF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi8gR29vZCB0aGluZ3MgY29tZSB3aGVuIHlvdSBsZWFzdCBleHBlY3QgXApcIHRoZW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8KICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICBcICAgXl9fXiAKICAgICAgICAgIFwgIChvbylcX19fX19fXwogICAgICAgICAgICAgKF9fKVwgICAgICAgKVwvXAogICAgICAgICAgICAgICAgIHx8LS0tLXcgfAogICAgICAgICAgICAgICAgIHx8ICAgICB8fAogICAgCjwvcHJlPgoKPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgp2YXIgYWRkdGhpc19zaGFyZSA9IHsKICAgIHRlbXBsYXRlczogewogICAgICAgIHR3aXR0ZXI6ICdce1x7dGl0bGVcfVx9IFx7XHt1cmxcfVx9JwogICAgfSwKfQo8L3NjcmlwdD4KCjwhLS0gQWRkVGhpcyBCdXR0b24gQkVHSU4gLS0+CjxkaXYgY2xhc3M9ImFkZHRoaXNfdG9vbGJveCBhZGR0aGlz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Sk7CgogIChmdW5jdGlvbigpIHsKICAgIHZhciBnYSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3NjcmlwdCcpOyBnYS50eXBlID0gJ3RleHQvamF2YXNjcmlwdCc7IGdhLmFzeW5jID0gdHJ1ZTsKICAgIGdhLnNyYyA9ICgnaHR0cHM6JyA9PSBkb2N1bWVudC5sb2NhdGlvbi5wcm90b2NvbCA/ICdodHRwczovL3NzbCcgOiAnaHR0cDovL3d3dycpICsgJy5nb29nbGUtYW5hbHl0aWNzLmNvbS9nYS5qcyc7CiAgICB2YXIgcyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzY3JpcHQnKVswXTsgcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZShnYSwgcyk7CiAgfSkoKTsKCjwvc2NyaXB0PgoKPC9ib2R5Pgo8L2h0bWw+Cg== +kind: ConfigMap +metadata: + annotations: + kudo.dev/phase: main + kudo.dev/plan: deploy + kudo.dev/step: genfiles + labels: + heritage: kudo + kudo.dev/instance: cowsay-instance + kudo.dev/operator: cowsay + name: cowsayinstance.deploy.main.genfiles.genwww.indexhtml + namespace: default From bb503d3dca344e680689f0730b98997f0156ff4c Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Mon, 3 Aug 2020 11:36:03 -0500 Subject: [PATCH 2/2] removing binary data from test assert Signed-off-by: Ken Sipe --- repository/cowsay/tests/cowsay-config-map/02-assert.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/repository/cowsay/tests/cowsay-config-map/02-assert.yaml b/repository/cowsay/tests/cowsay-config-map/02-assert.yaml index 221143c..c8dcc11 100644 --- a/repository/cowsay/tests/cowsay-config-map/02-assert.yaml +++ b/repository/cowsay/tests/cowsay-config-map/02-assert.yaml @@ -1,6 +1,4 @@ apiVersion: v1 -binaryData: - index.html: PGh0bWw+CjxoZWFkPgogIDx0aXRsZT5UaGUgY293IHNheXMgIkdvb2QgdGhpbmdzIGNvbWUgd2hlbiB5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