1 /*****************************************************************************\
2 * job_info-tst.c - exercise the Slurm job information API
3 *****************************************************************************
4 * Copyright (C) 2002 The Regents of the University of California.
5 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6 * Written by Morris Jette <jette1@llnl.gov> et.al.
7 * CODE-OCEC-09-009. All rights reserved.
8 *
9 * This file is part of Slurm, a resource management program.
10 * For details, see <https://slurm.schedmd.com/>.
11 * Please also read the included file: DISCLAIMER.
12 *
13 * Slurm is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU General Public License as published by the Free
15 * Software Foundation; either version 2 of the License, or (at your option)
16 * any later version.
17 *
18 * Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with Slurm; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 \*****************************************************************************/
27
28
29 #include <errno.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32
33 #include <slurm/slurm.h>
34 #include "testsuite/dejagnu.h"
35
36 /* main is used here for testing purposes only */
37 int
main(int argc,char * argv[])38 main (int argc, char *argv[])
39 {
40 static time_t last_update_time = (time_t) NULL;
41 int error_code;
42 job_info_msg_t * job_info_msg_ptr = NULL;
43
44 error_code = slurm_load_jobs (last_update_time, &job_info_msg_ptr, 1);
45 if (error_code) {
46 slurm_perror ("slurm_load_jobs");
47 return (error_code);
48 }
49
50 slurm_print_job_info_msg ( stdout, job_info_msg_ptr, 1 ) ;
51
52 slurm_free_job_info_msg ( job_info_msg_ptr ) ;
53 return (0);
54 }
55