ok(tmp != NULL,
"Validating session: session found");
- ok(tmp->kernel_session == NULL &&
- strlen(tmp->name),
- "Validating session: basic sanity check");
+ if (tmp) {
+ ok(tmp->kernel_session == NULL &&
+ strlen(tmp->name),
+ "Validating session: basic sanity check");
+ } else {
+ skip(1, "Skipping session validation check as session was not found");
+ goto end;
+ }
session_lock(tmp);
session_unlock(tmp);
session_put(tmp);
+end:
session_unlock_list();
}
ok(tmp != NULL,
"Destroying session: session found");
- ok(destroy_one_session(tmp) == 0,
- "Destroying session: %s destroyed",
- SESSION1);
+ if (tmp) {
+ ok(destroy_one_session(tmp) == 0,
+ "Destroying session: %s destroyed",
+ SESSION1);
+ } else {
+ skip(1, "Skipping session destruction as it was not found");
+ }
session_unlock_list();
}