open5gs/tests/slice/abts-main.c

71 lines
1.7 KiB
C
Raw Normal View History

2019-04-27 14:54:30 +00:00
/*
2020-05-25 16:15:22 +00:00
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
2019-04-27 14:54:30 +00:00
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2020-08-22 03:33:45 +00:00
#include "test-app.h"
2019-04-27 14:54:30 +00:00
2022-03-26 14:53:53 +00:00
abts_suite *test_same_dnn(abts_suite *suite);
abts_suite *test_different_dnn(abts_suite *suite);
abts_suite *test_paging(abts_suite *suite);
2019-04-27 14:54:30 +00:00
const struct testlist {
abts_suite *(*func)(abts_suite *suite);
} alltests[] = {
2022-03-26 14:53:53 +00:00
{test_same_dnn},
{test_different_dnn},
{test_paging},
2019-04-27 14:54:30 +00:00
{NULL},
};
static void terminate(void)
2019-04-27 14:54:30 +00:00
{
2019-06-15 07:16:32 +00:00
ogs_msleep(50);
test_child_terminate();
app_terminate();
2019-04-27 14:54:30 +00:00
2020-05-25 16:15:22 +00:00
test_5gc_final();
2019-09-13 12:07:47 +00:00
ogs_app_terminate();
2019-04-27 14:54:30 +00:00
}
static void initialize(const char *const argv[])
2019-04-27 14:54:30 +00:00
{
int rv;
rv = ogs_app_initialize(NULL, NULL, argv);
2019-09-13 12:07:47 +00:00
ogs_assert(rv == OGS_OK);
2020-05-25 16:15:22 +00:00
test_5gc_init();
2019-04-27 14:54:30 +00:00
rv = app_initialize(argv);
ogs_assert(rv == OGS_OK);
2019-04-27 14:54:30 +00:00
}
int main(int argc, const char *const argv[])
2019-04-27 14:54:30 +00:00
{
int i;
abts_suite *suite = NULL;
atexit(terminate);
test_app_run(argc, argv, "slice.yaml", initialize);
2019-04-27 14:54:30 +00:00
for (i = 0; alltests[i].func; i++)
suite = alltests[i].func(suite);
return abts_report(suite);
}