1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) 2018 Linux Test Project 4f08c3bdfSopenharmony_ci * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz 5f08c3bdfSopenharmony_ci */ 6f08c3bdfSopenharmony_ci 7f08c3bdfSopenharmony_ci#define TST_NO_DEFAULT_MAIN 8f08c3bdfSopenharmony_ci#include <stdlib.h> 9f08c3bdfSopenharmony_ci#include "tst_test.h" 10f08c3bdfSopenharmony_ci 11f08c3bdfSopenharmony_ciint main(int argc, char *argv[]) 12f08c3bdfSopenharmony_ci{ 13f08c3bdfSopenharmony_ci char *env; 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci tst_reinit(); 16f08c3bdfSopenharmony_ci 17f08c3bdfSopenharmony_ci if (argc != 2) 18f08c3bdfSopenharmony_ci tst_brk(TFAIL, "argc is %d, expected 2", argc); 19f08c3bdfSopenharmony_ci 20f08c3bdfSopenharmony_ci if (strcmp(argv[1], "canary")) 21f08c3bdfSopenharmony_ci tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]); 22f08c3bdfSopenharmony_ci 23f08c3bdfSopenharmony_ci env = getenv("LTP_TEST_ENV_VAR"); 24f08c3bdfSopenharmony_ci 25f08c3bdfSopenharmony_ci if (!env) 26f08c3bdfSopenharmony_ci tst_brk(TFAIL, "LTP_TEST_ENV_VAR is missing"); 27f08c3bdfSopenharmony_ci 28f08c3bdfSopenharmony_ci if (strcmp(env, "test")) 29f08c3bdfSopenharmony_ci tst_brk(TFAIL, "LTP_TEST_ENV_VAR='%s', expected test", env); 30f08c3bdfSopenharmony_ci 31f08c3bdfSopenharmony_ci if (getenv("PATH")) 32f08c3bdfSopenharmony_ci tst_brk(TFAIL, "PATH is in environment"); 33f08c3bdfSopenharmony_ci 34f08c3bdfSopenharmony_ci tst_res(TPASS, "%s executed", argv[0]); 35f08c3bdfSopenharmony_ci 36f08c3bdfSopenharmony_ci return 0; 37f08c3bdfSopenharmony_ci} 38