3916
3916
nih_list_free (&job->entry);
3919
/* Check that the hard resource limit can be set to unlimited with
3920
* a special argument of that name
3922
TEST_FEATURE ("with unlimited hard limit");
3923
jf = fopen (filename, "w");
3924
fprintf (jf, "exec /sbin/daemon\n");
3925
fprintf (jf, "limit core 10 unlimited\n");
3928
job = cfg_read_job (NULL, filename, "test");
3930
TEST_ALLOC_SIZE (job, sizeof (Job));
3932
TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job);
3933
TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, 10);
3934
TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, RLIM_INFINITY);
3936
nih_list_free (&job->entry);
3939
/* Check that the soft resource limit can be set to unlimited with
3940
* a special argument of that name
3942
TEST_FEATURE ("with unlimited soft limit");
3943
jf = fopen (filename, "w");
3944
fprintf (jf, "exec /sbin/daemon\n");
3945
fprintf (jf, "limit core unlimited 20\n");
3948
job = cfg_read_job (NULL, filename, "test");
3950
TEST_ALLOC_SIZE (job, sizeof (Job));
3952
TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job);
3953
TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, RLIM_INFINITY);
3954
TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, 20);
3956
nih_list_free (&job->entry);
3919
3959
/* Check that a limit stanza with the soft argument but no hard value
3920
3960
* results in a syntax error.