156
156
void test_upstart_with_apparmor_upgrade (const char *path);
157
157
void test_upstart_full_serialise_without_apparmor_upgrade (const char *path);
158
158
void test_upstart_full_serialise_with_apparmor_upgrade (const char *path);
159
void test_reload_signal_state (const char *path);
160
161
ConfSource * conf_source_from_path (const char *path,
161
162
ConfSourceType type,
200
201
{ "upstart-session.json", test_session_upgrade_midflight },
201
202
{ "upstart-session2.json", test_session_upgrade_exists },
202
203
{ "upstart-session-infinity.json", test_session_upgrade_stale },
204
{ "upstart-reload-signal.json", test_reload_signal_state },
584
586
if (obj_num_check (a, b, kill_signal))
589
if (obj_num_check (a, b, reload_signal))
587
592
if (obj_num_check (a, b, respawn))
2282
2287
class = file->job = job_class_new (NULL, "bar", NULL);
2283
2288
TEST_NE_P (class, NULL);
2289
class->reload_signal = SIGUSR1;
2284
2290
TEST_HASH_EMPTY (job_classes);
2285
2291
TEST_TRUE (job_class_consider (class));
2286
2292
TEST_HASH_NOT_EMPTY (job_classes);
4431
* test_reload_signal_state:
4433
* @path: full path to JSON data file to deserialise.
4435
* Test that Upstart is able to deserialise the 1.9-format JSON with the
4436
* addition of the reload signal stanza.
4439
test_reload_signal_state (const char *path)
4441
nih_local char *json_string = NULL;
4442
struct stat statbuf;
4453
TEST_LIST_EMPTY (sessions);
4454
TEST_LIST_EMPTY (events);
4455
TEST_LIST_EMPTY (conf_sources);
4456
TEST_HASH_EMPTY (job_classes);
4458
/* Check data file exists */
4459
TEST_EQ (stat (path, &statbuf), 0);
4461
json_string = nih_file_read (NULL, path, &len);
4462
TEST_NE_P (json_string, NULL);
4464
/* Recreate state from JSON data file */
4465
assert0 (state_from_string (json_string));
4467
TEST_LIST_EMPTY (sessions);
4468
TEST_LIST_NOT_EMPTY (events);
4469
TEST_HASH_NOT_EMPTY (job_classes);
4470
TEST_LIST_NOT_EMPTY (conf_sources);
4472
NIH_HASH_FOREACH (job_classes, iter) {
4473
JobClass *class = (JobClass *)iter;
4474
if (strcmp (class->name, "whoopsie") == 0) {
4475
TEST_EQ (class->reload_signal, SIGUSR1);
4477
TEST_EQ (class->reload_signal, SIGHUP);
4480
nih_free (conf_sources);
4481
nih_free (job_classes);
4483
nih_free (sessions);
4485
conf_sources = NULL;
4425
4498
* conf_source_from_path:
4427
4500
* @path: path to consider,