From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 50C2A80799 for ; Thu, 8 Oct 2026 03:55:01 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6983rlIV019100; Thu, 8 Oct 2026 06:53:48 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6983rlIV019100 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Uz3+wYBW" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6983rdnL019080 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 8 Oct 2026 06:53:39 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6983rdnL019080 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48b01a74792so3231880f8f.0 for ; Wed, 07 Oct 2026 20:53:39 -0700 (PDT) X-Gm-Message-State: AFq9FYIqecbGRNFJbBrE89o0eld7kPszTfMSxD03/WUlaGjVZl7vHT1K HsxsD2N7h72aYx3rSfU7Y8EZpbGzjIsoyNEzzwRR4nbD6tLhX7yb4JMJfkMKrjlm8zX+UAkUg+Y nvZikaWYymoMy+6UJgK0YDprQuhx0/bUfmcxqR8V9xQwcNu+AWzv4Mg== X-Gm-Gg: AYBFou0WJOELDfT/QZuUCfc0E4gHFQ1HmOsjvPraeTF2ROJzIlyzaUJXtImpAMbwU9t tH2fiAe93e6R1IKvFaE4KEhjpJPJojYvzlCy72QkCHjL6x5aBhzp8icB3FpVZD5DIr1F8/vAidH ErP56HrqTBmbUzjUP6ap9Ud7/99BKNin8FnZofeQixsKFQLhWyaGTd3e4NFCWQQ9IsXMjphPuEJ rzT8WnuiLv6A2rSf90GVsIZJlPo1DKx5h2lDovRj5fRkBEC1hK/WX4HFwHJDsFiafoC5DzuI4Em Z5tqC+tmSVQQQKtkeTNmgz+RKRAe0p6V/+t3bTp/QsBOjD1c/enOb/i7MFP6QBcVbZEpVZss8ig dteW6EN8107Ap/4HVlZvvsRY5 X-Received: by 2002:a05:6000:4b0a:b0:48c:4c06:448a with SMTP id ffacd0b85a97d-48c726f17e0mr8391550f8f.3.1791431619129; Wed, 07 Oct 2026 20:53:39 -0700 (PDT) X-Received: by 2002:a05:6000:4b0a:b0:48c:4c06:448a with SMTP id ffacd0b85a97d-48c726f17e0mr8391522f8f.3.1791431618552; Wed, 07 Oct 2026 20:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791431618; cv=none; d=google.com; s=arc-20260327; b=RojDtX8tSdmG7oidlynHkt43AEqR3NBaURqaKJqLDXiJar4OdwYloMCFcRAVjob2Ep NGG2F/cjm2+i1bj4DKC1dhLItglGMnUrkPLVaISA6ZzaDWFqDcvaYUtYnb24hiSIybKF JApgdxqUXz4U5PHXz9s5s+vrP0XnW8hKbhdFVeJNSGIttnQfQACqL8tMsBPVFPQtRPaj Und4eeYsMQCNB41jnyrE9th1KBWh4Hsma/+FwO9MIH4mzzpyEnqAPfWhwrwGqxapsmKJ 27+zV5dGbrp9rTiBntVRrXBQcHujcC2E2b525GXHZ7Ues3fNJVmOffxvHhhQQoWZXwnY 0X6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dMafvSxB8HRB0LWOaZ7eQe3b64MWgav1bNa6g29jwKo=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=ZmBGk/kQab2TicZuHnjEJLbqQEnYa9Gw5/ROQy6d0HsDICsF1EwKxpqPuY+bmIPa48 EHtmdcS1a5hNVSfGd31FjBeDnovIKRmPOPyqR0kRgWqYGBsOEChm5c84baHk9ifuWU4P Eiteu6kvCAqxMq6VI2ms+qlpBHm+J7d7B7di8DKdJAqti060gwAWOuqskKQz+EPzMv5f 0+zYvHJv9tZNAwQcGr7FgCCN42nWHsBc7fHurgGOSwcW7AMHAbQjYzzAz2m60ET668zV djwamR0DbSaGiFWOTa5Ij0hBjlGMUa0e9Bb70bmv1tuZcjCe+3OT0zpNcmjlHUedCj7a xq6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Uz3+wYBW; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48c724987bdsi7483071f8f.287.2026.10.07.20.53.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2026 20:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Uz3+wYBW; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=dMafvSxB8HRB0LWOaZ7eQe3b64MWgav1bNa6g29jwKo=; b=Uz3+wYBW3kUr hQnmJ/cEivrU2FEgA2ghKev04R+5WUIHjW+a6TN9ySf9yX4qVI1/QiaTmZdVs7uVkgsqpe7q/Sh3U sQPiCyb3sobuOo3hVhuP8UwjGP7jXdYMZ9zaKOe+HyHhaOUGi5/6Ju4XzqQ6xsqz3o4slWmyKfk81 sIUgfDreR0O9rypxMQxGtvD/oYR5aPTvpaqPFlT5fLiqfPBI7HQHQ4QN+WsbvU998QEyYKCUvOYVm pigz1StO8a4u8DQBeB5ozCkpgSldYUnyjz+KRl3H2zfaSBGl67hR5tFVeq+yCwlx+OrlOfudEKquG G6rOHST8vLATPXyzEJmEdA==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xEf94-003Uck-3B; Thu, 08 Oct 2026 05:53:36 +0200 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Thu, 8 Oct 2026 06:52:19 +0300 Message-ID: <20261008035335.2823931-3-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261008035335.2823931-1-eva.kurchatova@virtuozzo.com> References: <20261008035335.2823931-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v8 2/2] selftests: ve: introduce vtty pair teardown stress test X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Either end of a vtty pair creates it, and the last close tears it down. Race condition in older VZKernel vtty implementation allowed both sides to decide they were the final one and call release_tty() twice, and a master opening again while a teardown was in flight used to hand out a reference to a tty_struct about to be freed. Either way, this caused use-after-free. That issue was fixed in 23abb203a41a ("ve/vtty: fix use-after-free on concurrent tty close and reopen"). Hammer both ends for ownership correctness & thread safety verification. The original reproducer needed a few tens of minutes across a dozen containers, where vzctl interaction with vtty subsystem was a small part of the overall runtime, therefore it did not fire on every run. This test opens and closes nothing but the pair, from both ends and without pause, so the default stays in the tens of seconds and under the timeout of the suite, and VE_VTTY_SECS or argv[1] allows to control this. Nothing keeps veids unique and the vtty map is keyed by veid, so the test takes a random one high above the hand-given range, the way a container gets its id from a uuid. It also skips where /tmp is mounted nodev, where mknod() succeeds and no open does. The log is read every second, and a ring overrun, which loses records, counts as a complaint. https://virtuozzo.atlassian.net/browse/VSTOR-144771 Feature: ve selftests Signed-off-by: Eva Kurchatova --- tools/testing/selftests/ve/.gitignore | 1 + tools/testing/selftests/ve/Makefile | 3 +- tools/testing/selftests/ve/ve_vtty_stress.c | 415 ++++++++++++++++++++ 3 files changed, 418 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/ve/ve_vtty_stress.c diff --git a/tools/testing/selftests/ve/.gitignore b/tools/testing/selftests/ve/.gitignore index 3df4d05888dc..d8eb5c346c6e 100644 --- a/tools/testing/selftests/ve/.gitignore +++ b/tools/testing/selftests/ve/.gitignore @@ -1,3 +1,4 @@ ve_ns_owner_test ve_perms_test ve_mount_accounting_test +ve_vtty_stress diff --git a/tools/testing/selftests/ve/Makefile b/tools/testing/selftests/ve/Makefile index c6efe7c4b4fb..d287a73c5e97 100644 --- a/tools/testing/selftests/ve/Makefile +++ b/tools/testing/selftests/ve/Makefile @@ -1,9 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for ve selftests. -CFLAGS += -g -Wall -O2 +CFLAGS += -g -Wall -O2 $(KHDR_INCLUDES) TEST_GEN_PROGS += ve_ns_owner_test TEST_GEN_PROGS += ve_perms_test TEST_GEN_PROGS += ve_mount_accounting_test +TEST_GEN_PROGS += ve_vtty_stress include ../lib.mk diff --git a/tools/testing/selftests/ve/ve_vtty_stress.c b/tools/testing/selftests/ve/ve_vtty_stress.c new file mode 100644 index 000000000000..f4bdd81133b8 --- /dev/null +++ b/tools/testing/selftests/ve/ve_vtty_stress.c @@ -0,0 +1,415 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ve_vtty_stress - open and close a vtty pair from both ends at once. + * + * Either end of a vtty pair creates it, and the last close tears it down. + * + * Hammer both ends. The master comes from the vzctl ioctl, which does + * not look the VE up. The slave is reachable only from inside the VE, as + * TTY_MAJOR minor 1..MAX_NR_VTTY_CONSOLES, which vtty_driver() maps to + * vttys index minor - 1, so the test builds a VE with cgroup2, sets + * ve.veid to the cgroup it made, and runs the slave side there. + * + * A warning does not stop the host, so the run reads the kernel log too. + * One read() of /dev/kmsg is one record, so the test matches vtty driver + * splats, as well as generic kernel warning/oops/kasan reports. + * + * Usage: ve_vtty_stress [seconds] (default 30, or $VE_VTTY_SECS) + */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ve_selftest.h" +#include "../kselftest.h" + +#define VTTY_IDX 0 /* The pair both ends work on */ +#define SLAVE_MINOR (VTTY_IDX + 1) /* vtty_driver(): index = minor - 1 */ +#define DEFAULT_SECS 30 + +/* + * Expected open errno codes: the pair may be closing, or gone already, + * when an open lands on it. + * Anything else is an environment issue or a bug. + */ +static bool expected_errno(int err) +{ + return err == EBUSY || err == EIO || err == ENXIO; +} + +/* A runner timeout must still reach the cleanup */ +static volatile sig_atomic_t stop; + +static void on_signal(int sig) +{ + stop = sig; +} + +/* The handler interrupts a wait, the child is still to be reaped */ +static void wait_child(pid_t pid, int *status) +{ + *status = 0; + do { + if (stop) + kill(pid, SIGKILL); + } while (waitpid(pid, status, 0) < 0 && errno == EINTR); +} + +static int open_master(int ctl_fd, unsigned int veid) +{ + struct vzctl_ve_configure c = { + .veid = veid, + .key = VE_CONFIGURE_OPEN_TTY, + .val = VTTY_IDX, + }; + + return ioctl(ctl_fd, VZCTL_VE_CONFIGURE, &c); +} + +/* The slave end, inside the VE. Returns the errno that stopped it, or 0. */ +static int hammer_slave(const char *node, time_t deadline, + unsigned long *opened) +{ + int err = 0; + + while (time(NULL) < deadline) { + int fd = open(node, O_RDWR | O_NOCTTY | O_NONBLOCK); + + if (fd >= 0) { + (*opened)++; + close(fd); + } else if (!expected_errno(errno)) { + err = errno; + break; + } + } + + return err; +} + +/* The kernel log, since a warning fails nothing by itself. */ +static int kmsg_open(void) +{ + int fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK); + + if (fd >= 0) + lseek(fd, 0, SEEK_END); + return fd; +} + +/* + * Check for kernel log warnings, one read() per record, hence + * the function name is not checked. + */ +static int kmsg_check(int fd) +{ + /* How a warning, a splat or a sanitizer report starts in a record */ + static const char *const reports[] = { + "WARNING: ", "Oops", ";BUG", "kernel BUG at", "UBSAN: ", + "soft lockup - ", "general protection fault", "INFO: task ", + "rcu: INFO: ", + }; + char buf[8192]; + int found = 0; + ssize_t r; + size_t i; + + if (fd < 0) + return 0; + + for (;;) { + r = read(fd, buf, sizeof(buf) - 1); + if (r < 0) { + /* The ring wrapped since the last read, records are gone */ + if (errno == EPIPE) { + ksft_print_msg("kernel log overrun, records lost\n"); + found++; + continue; + } + /* Anything but the end of the log is a scan that stopped */ + if (errno != EAGAIN) { + ksft_print_msg("kernel log read: %s\n", + strerror(errno)); + found++; + } + break; + } + if (r == 0) + break; + buf[r] = '\0'; + /* Known symptoms of a buggy kernel */ + if (strstr(buf, "vtty") && (strstr(buf, "tty->count") || + strstr(buf, "bad slave count"))) { + ksft_print_msg("vtty mismatched count log: %s", buf); + found++; + } + for (i = 0; i < ARRAY_SIZE(reports); i++) { + if (!strstr(buf, reports[i])) + continue; + ksft_print_msg("kernel log: %s", buf); + found++; + break; + } + } + return found; +} + +int main(int argc, char **argv) +{ + unsigned long master_opened = 0, slave_opened = 0; + int cg, ctid, ctl, kmsg, ready[2], count[2], status; + unsigned int veid; + int master_err = 0, slave_err, complaints = 0; + const char *env = getenv("VE_VTTY_SECS"); + char path[PATH_MAX], val[16], c; + char dir[] = "/tmp/ve_vtty_XXXXXX"; + char node[sizeof(dir) + 6]; + struct namespace_ctx ns; + struct sigaction sa; + struct statvfs st; + time_t deadline, now, last = 0; + long secs; + pid_t pid, parent; + + ksft_print_header(); + secs = argc > 1 ? atol(argv[1]) : (env ? atol(env) : DEFAULT_SECS); + if (secs <= 0) + secs = DEFAULT_SECS; + + ctl = open("/dev/vzctl", O_RDWR); + if (ctl < 0) + ksft_exit_skip("cannot open /dev/vzctl: %s, the vz modules " + "(vzdev, vzmon) are needed\n", + strerror(errno)); + + cg = mount_cg2_fd(); + if (cg < 0) + ksft_exit_skip("cannot mount cgroup2: %s\n", strerror(errno)); + if (write_file_at(cg, "cgroup.subtree_control", VE_CONTROLLERS) < 0) + ksft_exit_skip("cannot enable the ve controller: %s\n", + strerror(errno)); + + /* Nothing is made yet, from here on a signal must reach the cleanup */ + sa.sa_handler = on_signal; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); + + ctid = make_ve(cg, CTID_MIN); + if (ctid < 0) + ksft_exit_skip("cannot make a VE cgroup\n"); + + /* The vtty map is keyed by veid: a random high one, as a container gets */ + if (getrandom(&veid, sizeof(veid), 0) != sizeof(veid)) { + status = errno; + destroy_ve(cg, ctid); + ksft_exit_skip("cannot draw a veid: %s\n", strerror(status)); + } + veid = (veid >> 2) | (1u << 30); + + /* The ve.veid must match between master / slave */ + snprintf(path, sizeof(path), "%d/ve.veid", ctid); + snprintf(val, sizeof(val), "%u", veid); + if (write_file_at(cg, path, val) < 0) { + status = errno; + destroy_ve(cg, ctid); + ksft_exit_skip("cannot set ve.veid: %s\n", strerror(status)); + } + + /* The log is the only detector of a teardown that does not crash */ + kmsg = kmsg_open(); + if (kmsg < 0) { + status = errno; + destroy_ve(cg, ctid); + ksft_exit_skip("cannot read /dev/kmsg: %s\n", strerror(status)); + } + + status = open_master(ctl, veid); + if (status < 0) { + status = errno; + destroy_ve(cg, ctid); + /* Absent or denied is the host's doing, anything else the kernel's */ + if (status == ENOTTY || status == ENODEV || status == ENOENT || + status == EPERM || status == EACCES) + ksft_exit_skip("no vtty master: %s\n", strerror(status)); + ksft_exit_fail_msg("cannot open the master: %s\n", + strerror(status)); + } + close(status); + + /* + * Use temp directory for the node the slave end opens. + * Cleaned up by the master side instead of relying on the slave. + */ + if (!mkdtemp(dir)) { + status = errno; + destroy_ve(cg, ctid); + ksft_exit_skip("mkdtemp: %s\n", strerror(status)); + } + /* A nodev mount takes the mknod() and refuses every open */ + if (statvfs(dir, &st) == 0 && (st.f_flag & ST_NODEV)) { + rmdir(dir); + destroy_ve(cg, ctid); + ksft_exit_skip("%s is on a nodev filesystem\n", dir); + } + snprintf(node, sizeof(node), "%s/slave", dir); + if (mknod(node, S_IFCHR | 0600, makedev(TTY_MAJOR, SLAVE_MINOR)) < 0) { + status = errno; + rmdir(dir); + destroy_ve(cg, ctid); + ksft_exit_skip("mknod: %s\n", strerror(status)); + } + + ksft_set_plan(1); + + if (pipe(ready) || pipe(count)) { + status = errno; + unlink(node); + rmdir(dir); + destroy_ve(cg, ctid); + ksft_exit_fail_msg("pipe: %s\n", strerror(status)); + } + + /* The VE of the cgroup, which the slave side enters */ + if (prepare_namespaces(&ns, CLONE_NEWVE, cg, ctid) < 0) { + unlink(node); + rmdir(dir); + destroy_ve(cg, ctid); + ksft_exit_fail_msg("cannot prepare the VE namespace\n"); + } + + deadline = time(NULL) + secs; + ksft_print_msg("VE %u, pair %d, %ld seconds\n", veid, VTTY_IDX, secs); + + parent = getpid(); + pid = fork(); + if (pid == 0) { + unsigned long n = 0; + int err; + + /* The parent stops the run, a signal here just ends this side */ + signal(SIGTERM, SIG_DFL); + signal(SIGINT, SIG_DFL); + close(ready[0]); + close(count[0]); + /* + * Hammering on after the run has given up would hold + * the cgroup open against destroy_ve(). + */ + prctl(PR_SET_PDEATHSIG, SIGKILL); + if (getppid() != parent) + _exit(0); + if (enter_cgroup(cg, ctid) < 0 || + enter_namespaces(&ns, CLONE_NEWVE) < 0) + _exit(errno ? errno : EIO); + + c = 'r'; + if (write(ready[1], &c, 1) != 1) + _exit(errno); + err = hammer_slave(node, deadline, &n); + /* Send the count either way: it says how far it got. */ + if (write(count[1], &n, sizeof(n)) != sizeof(n)) + _exit(errno); + _exit(err); + } else if (pid < 0) { + status = errno; + close_namespace_fds(&ns); + unlink(node); + rmdir(dir); + destroy_ve(cg, ctid); + ksft_exit_fail_msg("fork: %s\n", strerror(status)); + } + close(ready[1]); + close(count[1]); + + if (read(ready[0], &c, 1) != 1) { + /* A signal lands here too, with the child alive */ + kill(pid, SIGKILL); + wait_child(pid, &status); + close_namespace_fds(&ns); + unlink(node); + rmdir(dir); + destroy_ve(cg, ctid); + if (stop) + ksft_exit_fail_msg("stopped by signal %d\n", (int)stop); + ksft_exit_fail_msg("the VE side never came up: %s\n", + strerror(WIFEXITED(status) ? + WEXITSTATUS(status) : EINTR)); + } + + while (!stop && (now = time(NULL)) < deadline) { + int fd = open_master(ctl, veid); + + if (fd >= 0) { + master_opened++; + close(fd); + } else if (!expected_errno(errno)) { + master_err = errno; + break; + } + /* Drain the log as it fills, the ring is small */ + if (now != last) { + complaints += kmsg_check(kmsg); + last = now; + } + } + + if (master_err || stop) { + /* The other end runs to its own deadline, stop it */ + kill(pid, SIGKILL); + wait_child(pid, &status); + slave_err = 0; + } else { + if (read(count[0], &slave_opened, sizeof(slave_opened)) != + sizeof(slave_opened)) + slave_opened = 0; + wait_child(pid, &status); + slave_err = WIFEXITED(status) ? WEXITSTATUS(status) : EINTR; + } + + ksft_print_msg("%lu master opens, %lu slave opens\n", master_opened, + slave_opened); + + close_namespace_fds(&ns); + unlink(node); + rmdir(dir); + destroy_ve(cg, ctid); + /* The last close frees its tty from a work item, let that run first */ + usleep(100000); + status = complaints + kmsg_check(kmsg); + + /* A complaint outranks how the run ended */ + if (status) + ksft_exit_fail_msg("kernel complained %d time(s)\n", status); + if (stop) + ksft_exit_fail_msg("stopped by signal %d\n", (int)stop); + if (master_err) + ksft_exit_fail_msg("the master end stopped: %s\n", + strerror(master_err)); + /* Denied from the first open, by a device policy say */ + if (!slave_opened && (slave_err == EPERM || slave_err == EACCES || + slave_err == ENOENT || slave_err == ENODEV)) + ksft_exit_skip("the slave end cannot be opened: %s\n", + strerror(slave_err)); + if (slave_err) + ksft_exit_fail_msg("the slave end stopped: %s\n", + strerror(slave_err)); + if (!master_opened) + ksft_exit_fail_msg("no master was ever opened\n"); + if (!slave_opened) + ksft_exit_fail_msg("no slave was ever opened\n"); + + ksft_test_result_pass("vtty pair closed from both ends\n"); + ksft_finished(); +} -- 2.56.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel