Commit fb4bb207 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

add a tracefs test

Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 89e8aa90
......@@ -72,6 +72,7 @@
/static/mmx00
/static/mnt_ext_auto
/static/mnt_ext_master
/static/mnt_tracefs
/static/mnt_ro_bind
/static/mntns_deleted
/static/mntns_link_ghost
......
......@@ -236,6 +236,7 @@ TST_DIR = \
mnt_ext_auto \
mnt_ext_master \
mnt_ext_dev \
mnt_tracefs \
mntns_deleted \
unlink_regular00 \
mnt_enablefs \
......
#include <sys/mount.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <linux/limits.h>
#include <stdio.h>
#include <stdlib.h>
#include "zdtmtst.h"
const char *test_doc = "Test c/r of tracefs";
const char *test_author = "Tycho Andersen <tycho.andersen@canonical.com>";
char *dirname = "mnt_tracefs.test";
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char ** argv)
{
char dst[PATH_MAX], *root;
int status;
pid_t pid;
root = getenv("ZDTM_ROOT");
if (root == NULL) {
pr_perror("root");
return 1;
}
sprintf(dst, "%s/debugfs", getenv("ZDTM_ROOT"));
if (strcmp(getenv("ZDTM_NEWNS"), "1"))
goto test;
pid = fork();
if (pid < 0)
return 1;
if (pid == 0) {
test_ext_init(argc, argv);
mkdir(dst, 755);
if (mount("/sys/kernel/debug", dst, NULL, MS_BIND, NULL)) {
pr_perror("mount");
return 1;
}
return 0;
}
wait(&status);
if (status != 0)
return 1;
test:
test_init(argc, argv);
test_daemon();
test_waitsig();
pass();
return 0;
}
#!/bin/bash
# tracefs is automatically mounted under debugfs if the kernel has it, so we
# just need to check for a file in the tracing directory.
test -f /sys/kernel/debug/tracing/README || exit 1
{'flavor': 'uns', 'feature': 'mnt_id', 'opts': '--ext-mount-map auto --enable-external-masters'}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment