Skip to content

Commit 6c76940

Browse files
committed
Fix and enable the enriched format test
1 parent 04ea802 commit 6c76940

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#
2121

2222
AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src -I${top_srcdir}/common -I${top_srcdir}/auparse
23-
check_PROGRAMS = ilist_test slist_test # format_event_test
23+
check_PROGRAMS = ilist_test slist_test format_event_test
2424
TESTS = $(check_PROGRAMS)
2525
ilist_test_LDADD = ${top_builddir}/src/ausearch-int.o
2626
ilist_test_DEPENDENCIES = ${top_builddir}/src/ausearch-int.o

src/test/format_event_test.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ int main(void)
2929
return 1;
3030
}
3131

32-
const char *msg = "audit(0.0:1): op=test auid=-1 uid=2 gid=2 ses=-1";
32+
// Don't change this without adjusting offset to AUDIT_INTERP_SEPARATOR
33+
const char *msg = "audit(1170021493.5:100): pid=2000 uid=2 auid=-1 gid=2 ses=-1 msg=\'op=test\'\n";
3334
struct auditd_event *e;
3435

3536
e = create_event(NULL, NULL, NULL, 0);
@@ -62,11 +63,12 @@ int main(void)
6263
len_enriched);
6364
return 1;
6465
}
65-
if (!strchr(e->reply.message, AUDIT_INTERP_SEPARATOR)) {
66+
if (e->reply.message[95] != AUDIT_INTERP_SEPARATOR) {
6667
puts("missing AUDIT_INTERP_SEPARATOR");
68+
printf("char 95: 0x%X\n", e->reply.message[95]);
6769
return 1;
6870
}
69-
if (!strstr(e->reply.message, "AUID")) {
71+
if (!strstr(&(e->reply.message[95]), "AUID")) {
7072
puts("missing AUID interpretation");
7173
return 1;
7274
}

0 commit comments

Comments
 (0)