Project

General

Profile

Actions

action #34123

closed

[kernel]wicked_basic: invalid bash syntax

Added by dimstar about 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Bugs in existing tests
Target version:
Start date:
2018-03-31
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

https://openqa.opensuse.org/tests/647213#step/basic/15

# Result:
for dev in /sys/class/net/!(lo); do grep "down" $dev/operstate || (echo "device $dev is not down" && exit 1) ; done ; echo wKUv9-$?-
-bash: !: event not found
#

Actions #1

Updated by okurz about 6 years ago

  • Subject changed from wicked_basic: invalid bash syntax to [kernel]wicked_basic: invalid bash syntax
  • Category set to Bugs in existing tests
  • Assignee set to asmorodskyi
Actions #2

Updated by asmorodskyi about 6 years ago

PR which suppose to solve problem : https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/4757.

But currently it still failing , so need further investigations :

http://kimball.arch.suse.de/tests/1021#step/basic/15

Actions #3

Updated by dimstar about 6 years ago

Trying to summarize why this problem appeared all of a sudden and some specialties observed.

The command used by the test is/was:
for dev in /sys/class/net/!(lo); do ...; done

Now, '!' is the character for history expansion. History expansion is automatically disabled in some cases inside a command. According to the bash man page:

Several characters inhibit history expansion if found immediately following the history expansion cheven if it
is unquoted: space, tab, newline, carriage return, and =. If the extglob shell option is enabled, ( will also inhibit
expansion.

so, !( (from !(lo) ) is treated differently if extglob is enabled or disabled.

As for the reason why extglob status changed:

systemd had previously recommended systemd-bash-completion, which in turn required bash-completion. AS this was only one split out, and the same was not done for other shell-completions, the package was merged back into the main systemd package. As this is not explicitly bound to a shell in use, it does neither recommend not require bash-completion (which makes sense).

This, in turn," resulted in bash-completion no longer being auto-installed on a system (I submitted a pattern change to explicitly enable it on regular systems, as users of bash certainly profit from it)

bash-completion itself enables shopt extglob, which is how this all ever worked to start with. Merely a lot of luck

Actions #4

Updated by asmorodskyi about 6 years ago

Issue fixed by moving everything into sh script https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/4757

Actions #5

Updated by asmorodskyi about 6 years ago

  • Status changed from New to In Progress
Actions #6

Updated by sebchlad about 6 years ago

  • Target version set to 448
Actions #7

Updated by asmorodskyi almost 6 years ago

  • Status changed from In Progress to Resolved
Actions #8

Updated by sebchlad over 5 years ago

  • Target version changed from 448 to 445
Actions #9

Updated by sebchlad over 5 years ago

  • Target version changed from 445 to Done
Actions

Also available in: Atom PDF