Skip to content

Commit

Permalink
CT: change the nested groups in the GTP suites (#276)
Browse files Browse the repository at this point in the history
This makes the group hierarchy on the non proxy cases match the
proxy tests. It has ipv4 and ipv6 as root groups and nested
groups underneath.

Especially the PGW suite benefits from that. Selecting to run the
common IPv4 test suite was not successfull with the old ordering.
With the new setup `rebar3 ct .. --group=ipv4,common` works.
  • Loading branch information
RoadRunnr authored Dec 10, 2020
1 parent 40ec096 commit 089cdc9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 43 deletions.
21 changes: 12 additions & 9 deletions test/ggsn_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -392,20 +392,22 @@ init_per_suite(Config0) ->
end_per_suite(_Config) ->
ok.

init_per_group(ipv6, Config0) ->
init_per_group(common, Config) ->
lib_init_per_suite(Config);
init_per_group(ipv6, Config) ->
case ergw_test_lib:has_ipv6_test_config() of
true ->
Config = update_app_config(ipv6, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config);
update_app_config(ipv6, ?CONFIG_UPDATE, Config);
_ ->
{skip, "IPv6 test IPs not configured"}
end;
init_per_group(ipv4, Config0) ->
Config = update_app_config(ipv4, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config).
init_per_group(ipv4, Config) ->
update_app_config(ipv4, ?CONFIG_UPDATE, Config).

end_per_group(Group, Config)
end_per_group(Group, _Config)
when Group == ipv4; Group == ipv6 ->
ok;
end_per_group(common, Config) ->
ok = lib_end_per_suite(Config).

common() ->
Expand Down Expand Up @@ -462,8 +464,9 @@ common() ->
up_inactivity_timer].

groups() ->
[{ipv4, [], common()},
{ipv6, [], common()}].
[{common, [], common()},
{ipv4, [], [{group, common}]},
{ipv6, [], [{group, common}]}].

all() ->
[{group, ipv4},
Expand Down
49 changes: 24 additions & 25 deletions test/pgw_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -558,30 +558,33 @@ init_per_suite(Config0) ->
end_per_suite(_Config) ->
ok.

init_per_group(common, Config) ->
lib_init_per_suite(Config);
init_per_group(sx_fail, Config) ->
[{upf, false} | Config];
init_per_group(single_socket, Config) ->
AppCfg0 = proplists:get_value(app_cfg, Config),
lib_init_per_suite([{upf, false} | Config]);
init_per_group(single_socket, Config0) ->
AppCfg0 = proplists:get_value(app_cfg, Config0),
AppCfg = set_cfg_value([ergw, sockets, 'irx-socket', split_sockets], false, AppCfg0),
lists:keystore(app_cfg, 1, Config, {app_cfg, AppCfg});
init_per_group(ipv6, Config0) ->
Config = lists:keystore(app_cfg, 1, Config0, {app_cfg, AppCfg}),
lib_init_per_suite(Config);
init_per_group(ipv6, Config) ->
case ergw_test_lib:has_ipv6_test_config() of
true ->
Config = update_app_config(ipv6, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config);
update_app_config(ipv6, ?CONFIG_UPDATE, Config);
_ ->
{skip, "IPv6 test IPs not configured"}
end;
init_per_group(ipv4, Config0) ->
Config = update_app_config(ipv4, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config).
init_per_group(ipv4, Config) ->
update_app_config(ipv4, ?CONFIG_UPDATE, Config).

end_per_group(Group, Config)
when Group == ipv4; Group == ipv6 ->
ok = lib_end_per_suite(Config);
end_per_group(Group, _Config)
when Group == sx_fail; Group == single_socket ->
ok.
when Group == ipv4; Group == ipv6 ->
ok;
end_per_group(Group, Config)
when Group == common;
Group == sx_fail;
Group == single_socket ->
ok = lib_end_per_suite(Config).

common() ->
[invalid_gtp_pdu,
Expand Down Expand Up @@ -679,19 +682,15 @@ single_socket() ->
modify_bearer_command_congestion].

groups() ->
[{ipv4, [], common()},
{ipv6, [], common()},
{sx_fail, [{ipv4, [], sx_fail()},
{ipv6, [], sx_fail()}]},
{single_socket, [{ipv4, [], single_socket()},
{ipv6, [], single_socket()}]}
].
[{common, [], common()},
{sx_fail, [], sx_fail()},
{single_socket, [], single_socket()},
{ipv4, [], [{group, common}, {group, sx_fail}, {group, single_socket}]},
{ipv6, [], [{group, common}, {group, sx_fail}, {group, single_socket}]}].

all() ->
[{group, ipv4},
{group, ipv6},
{group, sx_fail},
{group, single_socket}].
{group, ipv6}].

%%%===================================================================
%%% Tests
Expand Down
21 changes: 12 additions & 9 deletions test/saegw_s11_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,22 @@ init_per_suite(Config0) ->
end_per_suite(_Config) ->
ok.

init_per_group(ipv6, Config0) ->
init_per_group(common, Config) ->
lib_init_per_suite(Config);
init_per_group(ipv6, Config) ->
case ergw_test_lib:has_ipv6_test_config() of
true ->
Config = update_app_config(ipv6, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config);
update_app_config(ipv6, ?CONFIG_UPDATE, Config);
_ ->
{skip, "IPv6 test IPs not configured"}
end;
init_per_group(ipv4, Config0) ->
Config = update_app_config(ipv4, ?CONFIG_UPDATE, Config0),
lib_init_per_suite(Config).
init_per_group(ipv4, Config) ->
update_app_config(ipv4, ?CONFIG_UPDATE, Config).

end_per_group(Group, Config)
end_per_group(Group, _Config)
when Group == ipv4; Group == ipv6 ->
ok;
end_per_group(common, Config) ->
ok = lib_end_per_suite(Config).

common() ->
Expand Down Expand Up @@ -430,8 +432,9 @@ common() ->
up_inactivity_timer].

groups() ->
[{ipv4, [], common()},
{ipv6, [], common()}].
[{common, [], common()},
{ipv4, [], [{group, common}]},
{ipv6, [], [{group, common}]}].

all() ->
[{group, ipv4},
Expand Down

0 comments on commit 089cdc9

Please sign in to comment.