bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: fix capability coloring


From: Jim Meyering
Subject: Re: [PATCH] ls: fix capability coloring
Date: Sun, 08 Nov 2009 18:24:42 +0100

Pádraig Brady wrote:
> Latest version at http://www.pixelbeat.org/ls-cap.diff

Thanks!
Looks fine, modulo a couple nits:

In ls.c,

  +      linkok = f->linkok -1;

s/-1/- 1/

  +                                        stat in the very unlikely case were
  +                                        C_CAP is set but not the others. */

s/were/where/


In tests/ls/capability, please change this
  \e[m" > out_ok || skip_test_ "Error printing expected output"
to this
  \e[m" > out_ok || framework_failure
or
  \e[m" > out_ok || fail=1
or maybe you'd like a new function, say fail_test_,
that exits right away and prints a reason for failure?

Most (all?) write failures should already cause test failures,
not "skipped" tests.  We tend to dismiss "skipped" tests.
------------------------------

Oops, the test fails for me on F12-beta, which has
libcap-2.16-5.fc12.x86_64.  I ran this:

    sudo make check -C tests TESTS=ls/capability VERBOSE=yes >& log

Sorry, but I won't have time to investigate tonight.






make: Entering directory `/home/j/w/co/cu/tests'
make  check-TESTS
make[1]: Entering directory `/home/j/w/co/cu/tests'
make[2]: Entering directory `/home/j/w/co/cu/tests'
FAIL: ls/capability
=======================================================
   GNU coreutils 8.0.107-3f836: tests/test-suite.log
=======================================================

1 of 1 test failed.

.. contents:: :depth: 2


FAIL: ls/capability (exit: 1)
=============================

+ ls --version
ls (GNU coreutils) 8.0.107-3f836
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
+ . ./test-lib.sh
++ unset function_test
++ eval 'function_test() { return 11; }; function_test'
+++ function_test
+++ return 11
++ test 11 '!=' 11
+++ pwd
++ test_dir_=/home/j/w/co/cu/tests
+++ this_test_
+++ echo ././ls/capability
+++ sed 's,.*/,,'
++ this_test=capability
+++ /home/j/w/co/cu/src/mktemp -d --tmp=/home/j/w/co/cu/tests 
cu-capability.XXXXXXXXXX
++ t_=/home/j/w/co/cu/tests/cu-capability.wtHWRVBq3k
++ trap remove_tmp_ 0
++ trap 'Exit $?' 1 2 13 15
++ cd /home/j/w/co/cu/tests/cu-capability.wtHWRVBq3k
++ diff --version
++ grep GNU
++ fail=0
+ require_root_
+ uid_is_privileged_
++ id -u
+ my_uid=0
+ case $my_uid in
+ NON_ROOT_USERNAME=nobody
++ id -g nobody
+ NON_ROOT_GROUP=99
+ grep '^#define HAVE_CAP 1$' /home/j/w/co/cu/lib/config.h
+ grep 'usage: setcap'
+ umask 22
+ mkdir test test/dir
+ cd test
+ touch cap_pos dir/cap_pos dir/cap_neg
+ for file in cap_pos dir/cap_neg
+ setcap cap_net_bind_service=ep cap_pos
+ for file in cap_pos dir/cap_neg
+ setcap cap_net_bind_service=ep dir/cap_neg
+ code='30;41'
+ for ex in ''\'''\''' ex=:
+ LS_COLORS='di=:ca=30;41'
+ ls --color=always cap_pos dir
+ env printf '\e[0m\e[30;41mcap_pos\e[0m

dir:
\e[30;41mcap_neg\e[0m
cap_pos
\e[m'
+ compare out out_ok
+ diff -u out out_ok
--- out 2009-11-08 18:17:45.286781576 +0100
+++ out_ok      2009-11-08 18:17:45.289781711 +0100
@@ -1,6 +1,6 @@
-cap_pos
+cap_pos

 dir:
-cap_neg
+cap_neg
 cap_pos
 
\ No newline at end of file
+ fail=1
+ for ex in ''\'''\''' ex=:
+ LS_COLORS='di=:ex=:ca=30;41'
+ ls --color=always cap_pos dir
+ env printf '\e[0m\e[30;41mcap_pos\e[0m

dir:
\e[30;41mcap_neg\e[0m
cap_pos
\e[m'
+ compare out out_ok
+ diff -u out out_ok
--- out 2009-11-08 18:17:45.295782282 +0100
+++ out_ok      2009-11-08 18:17:45.298781740 +0100
@@ -1,6 +1,6 @@
-cap_pos
+cap_pos

 dir:
-cap_neg
+cap_neg
 cap_pos
 
\ No newline at end of file
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /home/j/w/co/cu/tests
+ chmod -R u+rwx /home/j/w/co/cu/tests/cu-capability.wtHWRVBq3k
+ rm -rf /home/j/w/co/cu/tests/cu-capability.wtHWRVBq3k
+ exit 1
======================================
1 of 1 test failed
See tests/test-suite.log
Please report to address@hidden
======================================
make[2]: *** [test-suite.log] Error 1
make[2]: Leaving directory `/home/j/w/co/cu/tests'
make[1]: *** [check-TESTS] Error 2
make[1]: Leaving directory `/home/j/w/co/cu/tests'
make: *** [check-am] Error 2
make: Leaving directory `/home/j/w/co/cu/tests'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]