Skip to content

Commit e36a7e4

Browse files
committed
TEST/MEDIUM: Fix tests for HAProxy 3.3
Backends and frontends cannot share the same name. The program section has been removed.
1 parent 61aa0b9 commit e36a7e4

File tree

13 files changed

+34
-8
lines changed

13 files changed

+34
-8
lines changed

e2e/tests/binds/add.bats

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ load 'utils/_helpers'
6060

6161
@test "binds: Add a new bind for peers" {
6262
PARENT_NAME="fusion"
63-
if haproxy_version_ge "2.5"
63+
# segfault in v3.3
64+
if haproxy_version_ge "2.5" && !haproxy_version_ge "3.3"
6465
then
6566
resource_post "$_PEER_BASE_PATH/$PARENT_NAME/binds" "data/post_2.5.json" "force_reload=true"
6667
assert_equal "$SC" 201

e2e/tests/http_request_rules/data/haproxy_2.8.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ frontend test_frontend
3535
http-request del-header X-Del-Frontend if { src 10.1.0.0/16 }
3636
http-request sc-add-gpc(0,1) 1 if FALSE
3737

38-
frontend test_sticksc
38+
frontend front_sticksc
3939
bind *:1248
4040
default_backend test_sticksc
4141
http-request track-sc0 src table test_sticksc if TRUE

e2e/tests/http_request_rules/get_2.8.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ load 'utils/_helpers'
2727
@test "http_request_rules: Return one track-sc HTTP Request Rule from frontend" {
2828
if haproxy_version_ge "2.8"
2929
then
30-
PARENT_NAME="test_sticksc"
30+
PARENT_NAME="front_sticksc"
3131
resource_get "$_FRONTEND_BASE_PATH/$PARENT_NAME/http_request_rules/0"
3232
assert_equal "$SC" 200
3333
assert_equal "$(get_json_path "$BODY" ".type")" "track-sc"

e2e/tests/http_response_rules/data/haproxy_2.8.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ frontend test_frontend
3535
http-response del-header X-Del-Frontend if { src 10.1.0.0/16 }
3636
http-response sc-add-gpc(0,1) 1 if FALSE
3737

38-
frontend test_sticksc
38+
frontend front_sticksc
3939
bind *:1248
4040
default_backend test_sticksc
4141
http-response track-sc0 src table test_sticksc if TRUE

e2e/tests/http_response_rules/get_2.8.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ load 'utils/_helpers'
2828
@test "http_response_rules: Return one track-sc HTTP Response Rule from frontend" {
2929
if haproxy_version_ge "2.8"
3030
then
31-
PARENT_NAME="test_sticksc"
31+
PARENT_NAME="front_sticksc"
3232
resource_get "$_FRONTEND_BASE_PATH/$PARENT_NAME/http_response_rules/0"
3333
assert_equal "$SC" 200
3434
assert_equal "$(get_json_path "$BODY" ".type")" "track-sc"

e2e/tests/process_manager/create.bats

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

2627
@test "process-manager: Create one new program" {
28+
if haproxy_version_ge "3.3"; then skip "programs have been removed in haproxy 3.3"; fi
29+
2730
resource_post "$_PROGRAMS_BASE_PATH" "data/program.json" "force_reload=true"
2831
assert_equal "$SC" 201
2932

@@ -35,11 +38,15 @@ load 'utils/_helpers'
3538
}
3639

3740
@test "process-manager: Fail creating program with same name" {
41+
if haproxy_version_ge "3.3"; then skip; fi
42+
3843
resource_post "$_PROGRAMS_BASE_PATH" "data/program_duplicated.json" "force_reload=true"
3944
assert_equal "$SC" 409
4045
}
4146

4247
@test "process-manager: Fail creating program that isn't valid" {
48+
if haproxy_version_ge "3.3"; then skip; fi
49+
4350
resource_post "$_PROGRAMS_BASE_PATH" "data/program_invalid.json" "force_reload=true"
4451
assert_equal "$SC" 422
4552
}

e2e/tests/process_manager/delete.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

2627
@test "process-manager: Delete one program by name" {
28+
if haproxy_version_ge "3.3"; then skip; fi
29+
2730
resource_delete "$_PROGRAMS_BASE_PATH/echo" "force_reload=true"
2831
assert_equal "$SC" 204
2932

@@ -32,6 +35,8 @@ load 'utils/_helpers'
3235
}
3336

3437
@test "process-manager: Fail deleting app that doesn't exist" {
38+
if haproxy_version_ge "3.3"; then skip; fi
39+
3540
resource_delete "$_PROGRAMS_BASE_PATH/i_am_not_here" "force_reload=true"
3641
assert_equal "$SC" 404
3742
}

e2e/tests/process_manager/get.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

2627
@test "process-manager: Return one program by name" {
28+
if haproxy_version_ge "3.3"; then skip; fi
29+
2730
resource_get "$_PROGRAMS_BASE_PATH/echo"
2831
assert_equal "$SC" 200
2932
assert_equal "echo" "$(get_json_path "$BODY" ".name")"
3033
}
3134

3235
@test "process-manager: Fail returning program that doesn't exist" {
36+
if haproxy_version_ge "3.3"; then skip; fi
37+
3338
resource_get "$_PROGRAMS_BASE_PATH/i_am_not_here"
3439
assert_equal "$SC" 404
3540
}

e2e/tests/process_manager/list.bats

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

2627
@test "process-manager: Return an array of programs" {
28+
if haproxy_version_ge "3.3"; then skip; fi
29+
2730
resource_get "$_PROGRAMS_BASE_PATH"
2831
assert_equal "$SC" 200
2932
assert_equal 1 "$(get_json_path "$BODY" ". | length")"

e2e/tests/process_manager/replace.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
load '../../libs/dataplaneapi'
1919
load '../../libs/get_json_path'
2020
load '../../libs/haproxy_config_setup'
21+
load '../../libs/haproxy_version'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

2627
@test "process-manager: Replace one program" {
28+
if haproxy_version_ge "3.3"; then skip; fi
29+
2730
resource_put "$_PROGRAMS_BASE_PATH/echo" "data/program_duplicated.json" "force_reload=true"
2831
assert_equal "$SC" 200
2932

@@ -34,6 +37,8 @@ load 'utils/_helpers'
3437
}
3538

3639
@test "process-manager: Fail replacing program that doesn't exist" {
40+
if haproxy_version_ge "3.3"; then skip; fi
41+
3742
resource_put "$_PROGRAMS_BASE_PATH/i_am_not_here" "data/program_duplicated.json" "force_reload=true"
3843
assert_equal "$SC" 409
3944
}

0 commit comments

Comments
 (0)