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
|
|
|
|
2021-03-08 12:25:09 +00:00
|
|
|
abts_suite *test_nssai(abts_suite *suite);
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
const struct testlist {
|
|
|
|
abts_suite *(*func)(abts_suite *suite);
|
|
|
|
} alltests[] = {
|
2021-03-08 12:25:09 +00:00
|
|
|
{test_nssai},
|
2019-04-27 14:54:30 +00:00
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
2019-08-25 11:15:20 +00:00
|
|
|
static void terminate(void)
|
2019-04-27 14:54:30 +00:00
|
|
|
{
|
2019-06-15 07:16:32 +00:00
|
|
|
ogs_msleep(50);
|
|
|
|
|
2019-10-27 08:41:14 +00:00
|
|
|
test_child_terminate();
|
2019-08-25 11:15:20 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-10-27 08:41:14 +00:00
|
|
|
static void initialize(const char *const argv[])
|
2019-04-27 14:54:30 +00:00
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
|
2020-11-27 02:44:37 +00:00
|
|
|
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
|
|
|
|
2019-08-25 11:15:20 +00:00
|
|
|
rv = app_initialize(argv);
|
|
|
|
ogs_assert(rv == OGS_OK);
|
2019-04-27 14:54:30 +00:00
|
|
|
}
|
|
|
|
|
2019-10-27 08:41:14 +00:00
|
|
|
int main(int argc, const char *const argv[])
|
2019-04-27 14:54:30 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
abts_suite *suite = NULL;
|
|
|
|
|
2019-08-25 11:15:20 +00:00
|
|
|
atexit(terminate);
|
2021-03-08 12:25:09 +00:00
|
|
|
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);
|
|
|
|
}
|