File tree Expand file tree Collapse file tree 13 files changed +25
-40
lines changed
backend_switching_rules/data Expand file tree Collapse file tree 13 files changed +25
-40
lines changed Original file line number Diff line number Diff line change @@ -45,4 +45,4 @@ backend second_backend
45
45
backend test_backend
46
46
mode http
47
47
balance roundrobin
48
- option forwardfor
48
+ option forwardfor
Original file line number Diff line number Diff line change @@ -28,6 +28,6 @@ defaults
28
28
frontend test_frontend
29
29
mode tcp
30
30
maxconn 1000
31
- bind 192.168.1.1:80 name fixture
32
- bind 192.168.2.2:8080 name loopback
33
- option httpclose
31
+ bind localhost :9000 name fixture
32
+ bind localhost :9090 name loopback
33
+ option httpclose
Original file line number Diff line number Diff line change 1
1
{
2
2
"address" : " 127.0.0.1" ,
3
3
"name" : " test_bind" ,
4
- "port" : 80 ,
4
+ "port" : 10000 ,
5
5
"defer_accept" : true ,
6
6
"allow_0rtt" : true
7
7
}
Original file line number Diff line number Diff line change 2
2
"level" : " user" ,
3
3
"name" : " fixture" ,
4
4
"address" : " 127.0.0.1" ,
5
- "port" : 8080
5
+ "port" : 10001
6
6
}
Original file line number Diff line number Diff line change 1
1
{
2
- "cpu_maps" : null ,
3
2
"runtime_apis" : [
4
3
{
5
- "address" : " /var/run/haproxy/admin.sock" ,
6
- "level" : " admin" ,
7
- "mode" : " 660" ,
8
- "allow_0rtt" : true ,
9
- "name" : " runtime_api_1"
4
+ "address" : " /var/lib/haproxy/stats" ,
5
+ "level" : " admin"
10
6
}
11
7
],
12
8
"daemon" : " enabled" ,
13
- "lua_loads" : null ,
14
- "lua_prepend_path" : null ,
15
9
"master-worker" : true ,
16
10
"maxconn" : 5000 ,
17
- "pidfile" : " /var/run/haproxy/haproxy .pid"
11
+ "pidfile" : " /var/run/haproxy.pid"
18
12
}
Original file line number Diff line number Diff line change @@ -31,10 +31,7 @@ load 'utils/_helpers'
31
31
assert_equal " $SC " 200
32
32
assert_equal " $( get_json_path " $BODY " ' .data.maxconn' ) " " 5000"
33
33
assert_equal " $( get_json_path " $BODY " ' .data.daemon' ) " " enabled"
34
- assert_equal " $( get_json_path " $BODY " ' .data.pidfile' ) " " /var/run/haproxy/haproxy .pid"
35
- assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].address' ) " " /var/run /haproxy/admin.sock "
34
+ assert_equal " $( get_json_path " $BODY " ' .data.pidfile' ) " " /var/run/haproxy.pid"
35
+ assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].address' ) " " /var/lib /haproxy/stats "
36
36
assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].level' ) " " admin"
37
- assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].mode' ) " " 660"
38
- assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].allow_0rtt' ) " " true"
39
- assert_equal " $( get_json_path " $BODY " ' .data.runtime_apis[0].name' ) " " runtime_api_1"
40
37
}
Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ load 'utils/_helpers'
27
27
resource_post " $_PROGRAMS_BASE_PATH " " data/program.json" " force_reload=true"
28
28
assert_equal " $SC " 201
29
29
30
- resource_get " $_PROGRAMS_BASE_PATH /mirror "
30
+ resource_get " $_PROGRAMS_BASE_PATH /test "
31
31
assert_equal " $SC " 200
32
- assert_equal " mirror " " $( get_json_path " $BODY " " .data.name" ) "
32
+ assert_equal " test " " $( get_json_path " $BODY " " .data.name" ) "
33
33
assert_equal " nobody" " $( get_json_path " $BODY " " .data.user" ) "
34
34
assert_equal " nobody" " $( get_json_path " $BODY " " .data.group" ) "
35
35
}
Original file line number Diff line number Diff line change @@ -29,7 +29,3 @@ defaults
29
29
30
30
program echo
31
31
command echo "Hello, World!"
32
-
33
- program dataplaneapi
34
- command /usr/local/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /opt/hapee-2.5 /sbin/hapee-lb --config-file /etc/hapee-2.5 /hapee-lb.cfg --reload-cmd "systemctl reload hapee-2.5 " --reload-delay 5 --userlist haproxy-dataplaneapi
35
- no option start-on-reload
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " mirror" ,
3
- "command" : " spoa-mirror --runtime 0 --mirror-url http://test.local" ,
2
+ "name" : " test" ,
3
+ "command" : " echo true" ,
4
+ "start-on-reload" : " disabled" ,
4
5
"user" : " nobody" ,
5
6
"group" : " nobody"
6
7
}
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " dataplaneapi" ,
3
- "command" : " /usr/local/bin/dataplaneapi -f /path/to/file.cfg" ,
4
- "start-on-reload" : " disabled" ,
5
- "user" : " nobody" ,
6
- "group" : " nobody"
2
+ "name" : " echo" ,
3
+ "command" : " echo \" Hello Universe\" "
7
4
}
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ load '../../libs/version'
24
24
load ' utils/_helpers'
25
25
26
26
@test " process-manager: Return one program by name" {
27
- resource_get " $_PROGRAMS_BASE_PATH /dataplaneapi "
27
+ resource_get " $_PROGRAMS_BASE_PATH /echo "
28
28
assert_equal " $SC " 200
29
- assert_equal " dataplaneapi " " $( get_json_path " $BODY " " .data.name" ) "
29
+ assert_equal " echo " " $( get_json_path " $BODY " " .data.name" ) "
30
30
}
31
31
32
32
@test " process-manager: Fail returning program that doesn't exist" {
Original file line number Diff line number Diff line change @@ -26,5 +26,5 @@ load 'utils/_helpers'
26
26
@test " process-manager: Return an array of programs" {
27
27
resource_get " $_PROGRAMS_BASE_PATH "
28
28
assert_equal " $SC " 200
29
- assert_equal 2 " $( get_json_path " $BODY " " .data | length" ) "
29
+ assert_equal 1 " $( get_json_path " $BODY " " .data | length" ) "
30
30
}
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ load '../../libs/version'
24
24
load ' utils/_helpers'
25
25
26
26
@test " process-manager: Replace one program" {
27
- resource_put " $_PROGRAMS_BASE_PATH /dataplaneapi " " data/program_duplicated.json" " force_reload=true"
27
+ resource_put " $_PROGRAMS_BASE_PATH /echo " " data/program_duplicated.json" " force_reload=true"
28
28
assert_equal " $SC " 200
29
29
30
- resource_get " $_PROGRAMS_BASE_PATH /dataplaneapi "
30
+ resource_get " $_PROGRAMS_BASE_PATH /echo "
31
31
assert_equal " $SC " 200
32
- assert_equal " dataplaneapi " " $( get_json_path " $BODY " " .data.name" ) "
33
- assert_equal " /usr/local/bin/dataplaneapi -f /path/to/file.cfg " " $( get_json_path " $BODY " " .data.command" ) "
32
+ assert_equal " echo " " $( get_json_path " $BODY " " .data.name" ) "
33
+ assert_equal " echo \" Hello Universe \" " " $( get_json_path " $BODY " " .data.command" ) "
34
34
}
35
35
36
36
@test " process-manager: Fail replacing program that doesn't exist" {
You can’t perform that action at this time.
0 commit comments