From aece0f417f95252016aecb4375032bfb04366afa Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Tue, 18 Oct 2016 14:04:20 +0300 Subject: [PATCH] tests: check non-verbose capget/capset output * tests/caps-abbrev.awk: New file. * tests/caps-abbrev.c: Likewise. * tests/caps-abbrev.test: New test. * tests/.gitignore: Add caps-abbrev. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add caps-abbrev.test. (EXTRA_DIST): Add caps-abbrev.awk. --- tests/.gitignore | 1 + tests/Makefile.am | 3 +++ tests/caps-abbrev.awk | 52 ++++++++++++++++++++++++++++++++++++++++++ tests/caps-abbrev.c | 1 + tests/caps-abbrev.test | 11 +++++++++ 5 files changed, 68 insertions(+) create mode 100644 tests/caps-abbrev.awk create mode 100644 tests/caps-abbrev.c create mode 100755 tests/caps-abbrev.test diff --git a/tests/.gitignore b/tests/.gitignore index ca461d96..e1537f02 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -21,6 +21,7 @@ bpf brk btrfs caps +caps-abbrev chmod chown chown32 diff --git a/tests/Makefile.am b/tests/Makefile.am index 5489150f..b62f2568 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -81,6 +81,7 @@ check_PROGRAMS = \ brk \ btrfs \ caps \ + caps-abbrev \ chmod \ chown \ chown32 \ @@ -440,6 +441,7 @@ DECODER_TESTS = \ btrfs-w.test \ btrfs-vw.test \ caps.test \ + caps-abbrev.test \ chmod.test \ chown.test \ chown32.test \ @@ -780,6 +782,7 @@ AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh EXTRA_DIST = init.sh run.sh match.awk \ caps.awk \ + caps-abbrev.awk \ count-f.expected \ eventfd.expected \ fadvise.h \ diff --git a/tests/caps-abbrev.awk b/tests/caps-abbrev.awk new file mode 100644 index 00000000..86de7f23 --- /dev/null +++ b/tests/caps-abbrev.awk @@ -0,0 +1,52 @@ +#!/bin/gawk +# +# This file is part of caps strace test. +# +# Copyright (c) 2014-2016 Dmitry V. Levin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BEGIN { + cap = "(0|1<