about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-04-22 23:48:07 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-04-22 23:48:07 +0200
commit220d53a4d872e4965a46a6dc90f71e40f6ded3d8 (patch)
treebb0f937784d6a0f42d59d4d63a498c33d3c6c3ae /tests
parentTODO (diff)
downloadfs-tracer-220d53a4d872e4965a46a6dc90f71e40f6ded3d8.tar.gz
fs-tracer-220d53a4d872e4965a46a6dc90f71e40f6ded3d8.tar.bz2
fs-tracer-220d53a4d872e4965a46a6dc90f71e40f6ded3d8.zip
Add tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/a.outbin0 -> 15872 bytes
-rw-r--r--tests/log0
-rw-r--r--tests/openat.c26
-rw-r--r--tests/testfile4
4 files changed, 30 insertions, 0 deletions
diff --git a/tests/a.out b/tests/a.out
new file mode 100755
index 0000000..f601367
--- /dev/null
+++ b/tests/a.out
Binary files differdiff --git a/tests/log b/tests/log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/log
diff --git a/tests/openat.c b/tests/openat.c
new file mode 100644
index 0000000..62628cc
--- /dev/null
+++ b/tests/openat.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+int main(int argc, char** argv) {
+	printf("PID: %d\n", getpid());
+
+	int ret = syscall(SYS_openat, -100, "testfile", O_RDWR);
+	printf("Openat ret: %d\n", ret);
+
+	if (ret == -1) {
+		printf("Opneat error: %s\n", strerror(errno));
+	}
+
+	ret = syscall(SYS_write, ret, "writing this :)", 14);
+	printf("Write ret: %d\n", ret);
+
+	if (ret == -1) {
+		printf("Write error: %s\n", strerror(errno));
+	}
+
+	return 0;
+}
diff --git a/tests/testfile b/tests/testfile
new file mode 100644
index 0000000..f4ce76f
--- /dev/null
+++ b/tests/testfile
@@ -0,0 +1,4 @@
+writing this :t file
+
+
+I have multiple lines :)