Skip to content

Commit 265616a

Browse files
vgramermjuraga
authored andcommitted
BUILD/MINOR: ring e2e test >2.8 were not executed due to missing import lib
more over ring keyword doe snot exist in v2.1 Signed-off-by: Vincent Gramer <vgramer@haproxy.com>
1 parent 16c968f commit 265616a

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

e2e/tests/rings/data/post-ring2.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"description": "My Second local buffer",
3+
"format": "rfc3164",
4+
"maxlen": 1200,
5+
"name": "test_ring_2",
6+
"size": 32764,
7+
"timeout_connect": 5,
8+
"timeout_server": 10
9+
}

e2e/tests/rings/data/put.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "My local buffer update",
33
"format": "iso",
44
"maxlen": 1400,
5-
"name": "myring2",
5+
"name": "test_ring",
66
"size": 32740,
77
"timeout_connect": 15,
88
"timeout_server": 20

e2e/tests/rings/test.bats

+11-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@ load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/resource_client'
2121
load '../../libs/version'
22+
load '../../libs/haproxy_version'
2223

2324
load 'utils/_helpers'
2425

2526
@test "rings: Add a ring" {
26-
if haproxy_version_ge "2.1"
27+
if haproxy_version_ge "2.2"
2728
then
2829
resource_post "$_RING_BASE_PATH" "data/post.json" "force_reload=true"
2930
assert_equal "$SC" "201"
31+
32+
resource_post "$_RING_BASE_PATH" "data/post-ring2.json" "force_reload=true"
33+
assert_equal "$SC" "201"
3034
fi
3135
}
3236

3337
@test "rings: Return a ring" {
34-
if haproxy_version_ge "2.1"
38+
if haproxy_version_ge "2.2"
3539
then
3640
resource_get "$_RING_BASE_PATH/test_ring"
3741
assert_equal "$SC" 200
@@ -40,24 +44,25 @@ load 'utils/_helpers'
4044
}
4145

4246
@test "rings: Replace a ring" {
43-
if haproxy_version_ge "2.1"
47+
if haproxy_version_ge "2.2"
4448
then
4549
resource_put "$_RING_BASE_PATH/test_ring" "data/put.json" "force_reload=true"
4650
assert_equal "$SC" 200
4751
fi
4852
}
4953

5054
@test "rings: Return an array of rings" {
51-
if haproxy_version_ge "2.1"
55+
if haproxy_version_ge "2.2"
5256
then
5357
resource_get "$_RING_BASE_PATH"
5458
assert_equal "$SC" 200
55-
assert_equal "test_ring" "$(get_json_path "$BODY" '.data[0].name')"
59+
assert_equal "$(get_json_path "$BODY" ".data | length")" 2
60+
assert_equal "$(get_json_path "$BODY" ".data[] | select(.name | contains(\"test_ring_2\") ).name")" "test_ring_2"
5661
fi
5762
}
5863

5964
@test "rings: Delete a ring" {
60-
if haproxy_version_ge "2.1"
65+
if haproxy_version_ge "2.2"
6166
then
6267
resource_delete "$_RING_BASE_PATH/test_ring" "force_reload=true"
6368
assert_equal "$SC" 204

0 commit comments

Comments
 (0)