@@ -32,7 +32,6 @@ load 'utils/_helpers'
3232 # to /etc/haproxy/ssl during setup for some reason.
3333 dpa_docker_exec ' mv /ssl/* /etc/haproxy/ssl'
3434
35- debug " crt-list: upload a new list"
3635 assert dpa_docker_exec ' ls /etc/haproxy/ssl/crt-list.txt'
3736 refute dpa_docker_exec ' ls /etc/haproxy/ssl/crt-list2.txt'
3837 run dpa_curl_file_upload POST " $_STORAGE_SSL_CRT_LIST_PATH " " @$BATS_TEST_DIRNAME /data/crt-list2.txt;filename=crt-list2.txt"
@@ -42,28 +41,23 @@ load 'utils/_helpers'
4241 assert_equal " $( get_json_path " $BODY " ' .storage_name' ) " ' crt-list2.txt'
4342 assert dpa_docker_exec ' ls /etc/haproxy/ssl/crt-list2.txt'
4443
45- debug " crt-list files: replace a crt-list"
4644 run dpa_curl_text_plain PUT " $_STORAGE_SSL_CRT_LIST_PATH /crt-list2.txt" " @$BATS_TEST_DIRNAME /data/crt-list2.txt"
4745 assert_success
4846 dpa_curl_status_body ' $output'
4947 assert_equal " $SC " 202
5048
51- debug " crt-list files: get a list of crt-list files"
5249 resource_get " $_STORAGE_SSL_CRT_LIST_PATH "
5350 assert_equal " $SC " 200
5451 # [{"description":"managed certificate list","file":"/etc/haproxy/ssl/crt-list2.txt","storage_name":"crt-list2.txt"}]
5552 assert_equal " $( get_json_path " $BODY " ' .[0].file' ) " ' /etc/haproxy/ssl/crt-list.txt'
5653 assert_equal " $( get_json_path " $BODY " ' .|length' ) " 2
5754
58- debug " crt-list files: get a single crt-list"
5955 resource_get " $_STORAGE_SSL_CRT_LIST_PATH /crt-list2.txt"
6056 test " $BODY " = " $( cat $BATS_TEST_DIRNAME /data/crt-list2.txt) " || fail
6157
62- debug " crt-list files: delete a list"
6358 resource_delete " $_STORAGE_SSL_CRT_LIST_PATH /crt-list2.txt"
6459 assert_equal " $SC " 202
6560
66- debug " crt-list files: ensure the file has been deleted"
6761 resource_get " $_STORAGE_SSL_CRT_LIST_PATH "
6862 assert_equal " $SC " 200
6963 assert_equal " $( get_json_path " $BODY " ' .|length' ) " 1
@@ -72,26 +66,21 @@ load 'utils/_helpers'
7266@test " storage crt-list entries: all tests" {
7367 dpa_docker_exec ' mv /ssl/* /etc/haproxy/ssl'
7468
75- debug " crt-list entries: get the list of entries (1)"
7669 resource_get " $_STORAGE_SSL_CRT_LIST_PATH /crt-list.txt/entries"
7770 assert_equal " $SC " 200
7871 assert_equal " $( get_json_path " $BODY " ' .|length' ) " 1
7972
80- debug " crt-list entries: add a new entry"
8173 resource_post " $_STORAGE_SSL_CRT_LIST_PATH /crt-list.txt/entries" " data/post.json"
8274 assert_equal " $SC " 201
8375 assert_equal " $( get_json_path " $BODY " ' .file' ) " ' /etc/haproxy/ssl/1.pem'
8476
85- debug " crt-list entries: get the list of entries (2)"
8677 resource_get " $_STORAGE_SSL_CRT_LIST_PATH /crt-list.txt/entries"
8778 assert_equal " $SC " 200
8879 assert_equal " $( get_json_path " $BODY " ' .|length' ) " 2
89-
90- debug " crt-list entries: delete an entry"
80+
9181 resource_delete " $_STORAGE_SSL_CRT_LIST_PATH /crt-list.txt/entries" " certificate=/etc/haproxy/ssl/1.pem&line_number=1"
9282 assert_equal " $SC " 204
9383
94- debug " crt-list entries: get the list of entries (3)"
9584 resource_get " $_STORAGE_SSL_CRT_LIST_PATH /crt-list.txt/entries"
9685 assert_equal " $SC " 200
9786 assert_equal " $( get_json_path " $BODY " ' .|length' ) " 1
0 commit comments