mirror of
https://github.com/systemd/systemd
synced 2026-03-19 03:24:45 +01:00
Compare commits
7 Commits
abfbfee36c
...
b905f3bbba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b905f3bbba | ||
|
|
de806cd6b6 | ||
|
|
36ec026830 | ||
|
|
6a0667d2b6 | ||
|
|
df7ca94009 | ||
|
|
179ca4d2b1 | ||
|
|
907300c3c3 |
@ -69,7 +69,7 @@ _bootctl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
comps=''
|
||||
|
||||
@ -140,7 +140,7 @@ _busctl() {
|
||||
|
||||
n=$(($COMP_CWORD - $i))
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
comps=''
|
||||
|
||||
@ -83,7 +83,7 @@ _coredumpctl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then
|
||||
comps=''
|
||||
|
||||
@ -170,7 +170,7 @@ _homectl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[NAME]}; then
|
||||
comps=$(__get_homes)
|
||||
|
||||
@ -39,7 +39,7 @@ _hostnamectl() {
|
||||
[ARG]='-H --host -M --machine --json'
|
||||
)
|
||||
|
||||
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
case $prev in
|
||||
--host|-H)
|
||||
comps=$(compgen -A hostname)
|
||||
@ -77,7 +77,7 @@ _hostnamectl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[CHASSIS]}; then
|
||||
comps='desktop laptop convertible server tablet handset watch embedded vm container'
|
||||
|
||||
@ -67,7 +67,7 @@ _localectl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[VARIANTS]}; then
|
||||
comps=$(command localectl list-x11-keymap-layouts)
|
||||
|
||||
@ -93,7 +93,7 @@ _loginctl () {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps="${VERBS[*]}"
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[SESSIONS]}; then
|
||||
|
||||
@ -95,7 +95,7 @@ _machinectl() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
|
||||
@ -69,7 +69,7 @@ _networkctl() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
comps=''
|
||||
|
||||
@ -79,7 +79,7 @@ _portablectl() {
|
||||
|
||||
n=$(($COMP_CWORD - $i))
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
comps=''
|
||||
|
||||
@ -87,7 +87,7 @@ _resolvectl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps="${VERBS[*]}"
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[DOMAIN]}; then
|
||||
|
||||
@ -254,7 +254,7 @@ _systemctl () {
|
||||
cur_orig="$(printf '%q' $cur)"
|
||||
fi
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps="${VERBS[*]}"
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[ALL_UNITS]}; then
|
||||
|
||||
@ -93,12 +93,12 @@ _systemd_analyze() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -z $verb && $cur = -* ]]; then
|
||||
if [[ -z ${verb-} && $cur = -* ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
|
||||
@ -48,12 +48,12 @@ _systemd-delta() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" = -* ]] || [[ -z ${comps-} ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") )
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ _systemd_id128() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
|
||||
comps=''
|
||||
|
||||
@ -71,7 +71,7 @@ _systemd-resolve() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" = -* ]] || [[ -z ${comps-} ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -76,7 +76,7 @@ _timedatectl() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
comps=${VERBS[*]}
|
||||
elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then
|
||||
comps='true false'
|
||||
|
||||
@ -73,7 +73,7 @@ _udevadm() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
if [[ -z ${verb-} ]]; then
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[COMMON]} ${OPTS[DEBUG]}' -- "$cur") )
|
||||
else
|
||||
|
||||
@ -9,6 +9,18 @@ TEST_REQUIRE_INSTALL_TESTS=0
|
||||
# shellcheck source=test/test-functions
|
||||
. "${TEST_BASE_DIR:?}/test-functions"
|
||||
|
||||
# Explicitly override the default test_create_image() function to avoid the
|
||||
# call to mask_supporting_services(), since we want to run them in TEST-01-BASIC
|
||||
test_create_image() {
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
setup_basic_environment
|
||||
)
|
||||
}
|
||||
|
||||
test_append_files() {
|
||||
# install tests manually so the test is functional even when -Dinstall-tests=false
|
||||
local dst="${1:?}/usr/lib/systemd/tests/testdata/units/"
|
||||
|
||||
@ -2416,13 +2416,7 @@ test_create_image() {
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
setup_basic_environment
|
||||
|
||||
# We want to test all services in TEST-01-BASIC, but mask them in
|
||||
# all other tests
|
||||
if [[ "$TESTID" != "01" ]]; then
|
||||
dinfo "Masking supporting services"
|
||||
mask_supporting_services
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -82,12 +82,19 @@ check_freezer_state() {
|
||||
name="${1%.$suffix}"
|
||||
object_path="/org/freedesktop/systemd1/unit/${name//-/_2d}_2e${suffix}"
|
||||
|
||||
for _ in {0..10}; do
|
||||
state=$(busctl get-property \
|
||||
org.freedesktop.systemd1 \
|
||||
"${object_path}" \
|
||||
org.freedesktop.systemd1.Unit \
|
||||
FreezerState | cut -d " " -f2 | tr -d '"')
|
||||
|
||||
# Ignore the intermediate freezing & thawing states in case we check
|
||||
# the unit state too quickly
|
||||
[[ "$state" =~ ^(freezing|thawing)$ ]] || break
|
||||
sleep .5
|
||||
done
|
||||
|
||||
[ "$state" = "$2" ] || {
|
||||
echo "error: unexpected freezer state, expected: $2, actual: $state" >&2
|
||||
exit 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user