Project

General

Profile

Actions

Bug #14446

closed

ar cqs doesn't work

Added by Robert Mustacchi 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

After #14105, ar cqs doesn't work. In this case, the problem is that the checks we added for whether or not the input archive was required missed that cqs was a valid combination (it wasn't documented). However, folks still use it and it's been noticed in the wild. As a result, we need to actually make sure this works. As part of this we'll add some additional regression tests to the ar test suite to try and verify against this. In addition, we'll try to improve some of the error messages here to help distinguish some of the error cases which caused some confusion on the initial debugging.


Related issues

Related to illumos gate - Feature #14105: ar -s could work on its ownClosedRobert Mustacchi

Actions
Actions #1

Updated by Electric Monk 7 months ago

  • Gerrit CR set to 1979
Actions #2

Updated by Robert Mustacchi 6 months ago

To test this we did a few things:

  • Hans rebuilt things against the updated ar which originally triggered this
  • I ran the updated tests against this, documented below on their own and in the broader util tests.
rm@beowulf:~$ /opt/util-tests/tests/ar/artest 
TEST PASSED: basic archive creation
TEST PASSED: restoring stripped archive with -s
TEST PASSED: restoring stripped archive with -st
TEST PASSED: ar -sv has proper output
TEST PASSED: restoring stripped archive with -sv
ar: creating /tmp/ar.544/rs.a
TEST PASSED: ar -rs creates archives
TEST PASSED: ar -crs creates archives
TEST PASSED: incremental archive creation
TEST PASSED: positional tests: ar -cra
TEST PASSED: positional tests: ar -crb
TEST PASSED: positional tests: ar -cri
TEST PASSED: ar -x
ar: ar_test0.o already exists. Will not be extracted
TEST PASSED: ar -Cx did not overwrite existing file
TEST PASSED: ar -Cx extracted file that didn't exist
TEST PASSED: ar -xs
TEST PASSED: ar -ma
TEST PASSED: ar -mb
TEST PASSED: ar -t (output 01)
TEST PASSED: ar -t (output 10)
ar: creating /tmp/ar.544/q.a
TEST PASSED: ar -q creates archives
TEST PASSED: ar -cq creates archives
TEST PASSED: ar -cqs creates archives
TEST PASSED: invalid arguments 
TEST PASSED: invalid arguments -z
TEST PASSED: invalid arguments -d
TEST PASSED: invalid arguments -d /tmp/ar.544/enoent
TEST PASSED: invalid arguments -d /tmp/ar.544/test01.a foobar.exe
TEST PASSED: invalid arguments -m /tmp/ar.544/enoent
TEST PASSED: invalid arguments -ma foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -mb foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -mi foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -p /tmp/ar.544/enoent
TEST PASSED: invalid arguments -P /tmp/ar.544/enoent
TEST PASSED: invalid arguments -q
TEST PASSED: invalid arguments -qa foobar.exe .a
TEST PASSED: invalid arguments -qb foobar.exe .a
TEST PASSED: invalid arguments -qi foobar.exe .a
TEST PASSED: invalid arguments -qa ar_test0.o .a
TEST PASSED: invalid arguments -qb ar_test0.o .a
TEST PASSED: invalid arguments -qi ar_test0.o .a
TEST PASSED: invalid arguments -r
TEST PASSED: invalid arguments -ra foobar.exe
TEST PASSED: invalid arguments -ra foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -rb foobar.exe
TEST PASSED: invalid arguments -rb foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -ri foobar.exe
TEST PASSED: invalid arguments -ri foobar.exe /tmp/ar.544/enoent
TEST PASSED: invalid arguments -t
TEST PASSED: invalid arguments -t /tmp/ar.544/enoent
TEST PASSED: invalid arguments -x
TEST PASSED: invalid arguments -x /tmp/ar.544/enoent
TEST PASSED: invalid arguments -s
TEST PASSED: invalid arguments -s /tmp/ar.544/enoent
TEST PASSED: invalid arguments -s /tmp/ar.544/test01.a /tmp/ar.544/test10.a
TEST PASSED: invalid arguments -sz /tmp/ar.544/test01.a
TEST PASSED: invalid arguments -rd
TEST PASSED: invalid arguments -xd
TEST PASSED: invalid arguments -qp
All tests passed successfully!
rm@beowulf:~$ pfexec /opt/util-tests/bin/utiltest 
Test: /opt/util-tests/tests/allowed-ips (run as root)             [00:00] [PASS]
Test: /opt/util-tests/tests/ar/artest (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/chown_test (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/date_test (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/find/findtest (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/grep_test (run as root)               [00:02] [PASS]
Test: /opt/util-tests/tests/head/head_test (run as root)          [00:00] [PASS]
Test: /opt/util-tests/tests/libjedec_test (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/libsff/libsff (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/make_test (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/mdb/mdbtest (run as root)             [00:01] [PASS]
Test: /opt/util-tests/tests/mergeq/mqt (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/mergeq/wqt (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/pcidbtest (run as root)               [00:01] [PASS]
Test: /opt/util-tests/tests/pcieadm-priv (run as root)            [00:01] [PASS]
Test: /opt/util-tests/tests/pcieadmtest (run as root)             [00:02] [PASS]
Test: /opt/util-tests/tests/printf_test (run as root)             [00:00] [PASS]
Test: /opt/util-tests/tests/set-linkprop (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/sleep/sleeptest (run as root)         [00:17] [PASS]
Test: /opt/util-tests/tests/smbios (run as root)                  [00:00] [PASS]
Test: /opt/util-tests/tests/svr4pkg_test (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/xargs_test (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/awk/runtests.sh (run as nobody)       [02:50] [PASS]
Test: /opt/util-tests/tests/ctf/precheck (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/ctf/ctftest (run as root)             [00:05] [PASS]
Test: /opt/util-tests/tests/demangle/afl-fast (run as root)       [00:01] [PASS]
Test: /opt/util-tests/tests/demangle/gcc-libstdc++ (run as root)  [00:00] [PASS]
Test: /opt/util-tests/tests/demangle/llvm-stdcxxabi (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libcustr/custr_remove (run as root)   [00:00] [PASS]
Test: /opt/util-tests/tests/libcustr/custr_trunc (run as root)    [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_00_blank (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_01_boolean (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_02_numbers (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_03_empty_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_04_number_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_05_strings (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_06_nested (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_07_nested_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/sed/sed_addr (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/sed/multi_test (run as root)          [00:00] [PASS]

Results Summary
PASS      40

Running Time:   00:03:28
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20220129T193242
Actions #3

Updated by Robert Mustacchi 6 months ago

Actions #4

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 11029d9dcf6c3fb63ae0cbb0ad67f86d267db4eb

commit  11029d9dcf6c3fb63ae0cbb0ad67f86d267db4eb
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2022-01-31T23:05:47.000Z

    14446 ar cqs doesn't work
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF