Ticket #3866 (new defect)

Opened 6 years ago

Last modified 6 years ago

building as root breaks the tests

Reported by: anatoly.borodin Owned by:
Priority: minor Milestone: Future Releases
Component: tests Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c contains code to replace the numeric uids and gids with '<<uid>>'/'<<gid>>' if they are equal to the ids of the process. Running the tests as root breaks the tests, because '<<uid>>' / '<<gid>>' appear where 0 are expected.

Looking in tests/src/vfs/extfs/helpers-list/test-suite.log:

...
------------ diff of the expected output vs the actual output: -------------
--- /root/mc/tests/src/vfs/extfs/helpers-list/data/hp48+.output 2017-10-01 21:14:01.070736734 +0000
+++ /tmp/hp48+.actual-parsed-output.l8hNvZZv    2017-10-01 21:14:12.875106282 +0000
@@ -1,3 +1,3 @@
--rw-r--r--   1        0        0         30 /YEN
--rw-r--r--   1        0        0      21848 /JYTLIGHT
--rw-r--r--   1        0        0         37 /IOPAR
+-rw-r--r--   1  <<uid>>  <<gid>>         30 /YEN
+-rw-r--r--   1  <<uid>>  <<gid>>      21848 /JYTLIGHT
+-rw-r--r--   1  <<uid>>  <<gid>>         37 /IOPAR
------------------------------- end of diff --------------------------------
...

I don't know if it's intended, or a bug.

Change History

comment:1 Changed 6 years ago by anatoly.borodin

PS Some may argue that it's not really a problem: just build mc as a normal user. But building in docker can be tricky, as the default user is 0 there, so you need to either patch the test files, or create a normal user just for the tests...

comment:2 Changed 6 years ago by merinoff

It seems, the .output file is wrong. symbolic_uid func has to return:
the uid as-is, or as "<<uid>>" if the same as current user.

Same for gid. So the check input for the test seems to be wrong.

Note: See TracTickets for help on using tickets.