File tree Expand file tree Collapse file tree 6 files changed +157
-0
lines changed Expand file tree Collapse file tree 6 files changed +157
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ CURL_RESPONSE=$(
19
+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20
+ )
21
+
22
+ # Log-Endpoint Test Assertion:
23
+ echo "The HTTP Code is $CURL_RESPONSE (an internal JWT token is needed for full access)"
24
+ [ "$CURL_RESPONSE" -eq 403 ]
25
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ CURL_RESPONSE=$(
19
+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20
+ )
21
+
22
+ # Log-Endpoint Test Assertion:
23
+ echo "The HTTP Code is $CURL_RESPONSE (an internal JWT token is needed for full access)"
24
+ [ "$CURL_RESPONSE" -eq 403 ]
25
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ # Rolegroup custom-log-config
19
+ CURL_RESPONSE_CUSTOM=$(
20
+ kubectl -n $NAMESPACE exec airflow-webserver-custom-log-config-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-custom-log-config-headless:8793 2>/dev/null || true);echo "$CODE"'
21
+ )
22
+
23
+ # Log-Endpoint Test Assertions:
24
+ echo "The HTTP Code is $CURL_RESPONSE_CUSTOM (an internal JWT token is needed for full access)"
25
+
26
+ # Rolegroup automatic-log-config
27
+ CURL_RESPONSE_AUTO=$(
28
+ kubectl -n $NAMESPACE exec airflow-webserver-automatic-log-config-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-automatic-log-config-headless:8793 2>/dev/null || true);echo "$CODE"'
29
+ )
30
+ echo "The HTTP Code is $CURL_RESPONSE_AUTO (an internal JWT token is needed for full access)"
31
+ [ "$CURL_RESPONSE_CUSTOM" -eq 403 ] && [ "$CURL_RESPONSE_AUTO" -eq 403 ]
32
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ CURL_RESPONSE=$(
19
+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20
+ )
21
+
22
+ # Log-Endpoint Test Assertion:
23
+ echo "The HTTP Code is $CURL_RESPONSE (an internal JWT token is needed for full access)"
24
+ [ "$CURL_RESPONSE" -eq 403 ]
25
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ CURL_RESPONSE=$(
19
+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20
+ )
21
+
22
+ # Log-Endpoint Test Assertion:
23
+ echo "The HTTP Code is $CURL_RESPONSE (an internal JWT token is needed for full access)"
24
+ [ "$CURL_RESPONSE" -eq 403 ]
25
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kuttl.dev/v1beta1
3
+ kind: TestAssert
4
+ metadata:
5
+ name: test-log-endpoint
6
+ timeout: 240
7
+ commands:
8
+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9
+ - script: |
10
+ set -eu
11
+
12
+ # Log-Endpoint Test:
13
+ # This is executed from the Webserver as JWT keys must be present.
14
+ # A small server is started on each worker that serves the logs on its
15
+ # 8793 port for the Webserver: we don't use the token as that is an
16
+ # internal implementation, but check that the endpoint is reachable,
17
+ # indicated by a 403.
18
+ CURL_RESPONSE=$(
19
+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20
+ )
21
+
22
+ # Log-Endpoint Test Assertion:
23
+ echo "The HTTP Code is $CURL_RESPONSE (an internal JWT token is needed for full access)"
24
+ [ "$CURL_RESPONSE" -eq 403 ]
25
+ {% endif %}
You can’t perform that action at this time.
0 commit comments