1 /******************************************************************************
2 * Copyright (c) Crackerjack Project., 2007 *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See *
12 * the GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the Free Software Foundation, *
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
17 * *
18 ******************************************************************************/
19
20 /*
21 * Basic test for the add_key() syscall.
22 *
23 * History: Porting from Crackerjack to LTP is done by
24 * Manas Kumar Nayak maknayak@in.ibm.com>
25 */
26
27 #include <errno.h>
28
29 #include "tst_test.h"
30 #include "lapi/keyctl.h"
31
verify_add_key(void)32 static void verify_add_key(void)
33 {
34 TEST(add_key("keyring", "wjkey", NULL, 0, KEY_SPEC_THREAD_KEYRING));
35 if (TEST_RETURN == -1)
36 tst_res(TFAIL | TTERRNO, "add_key call failed");
37 else
38 tst_res(TPASS, "add_key call succeeded");
39 }
40
41 static struct tst_test test = {
42 .test_all = verify_add_key,
43 };
44