Skip to content

Commit

Permalink
Merge pull request systemd#30200 from mrc0mmand/test-tweaks
Browse files Browse the repository at this point in the history
A couple of assorted fixes
  • Loading branch information
yuwata authored Nov 26, 2023
2 parents 8add4a9 + 7a2d6c2 commit 54f3b3d
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/import/export-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static void raw_export_report_progress(RawExport *e) {
if (!ratelimit_below(&e->progress_ratelimit))
return;

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_info("Exported %u%%.", percent);

e->last_percent = percent;
Expand Down
2 changes: 1 addition & 1 deletion src/import/export-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void tar_export_report_progress(TarExport *e) {
if (!ratelimit_below(&e->progress_ratelimit))
return;

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_info("Exported %u%%.", percent);

e->last_percent = percent;
Expand Down
2 changes: 1 addition & 1 deletion src/import/import-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void raw_import_report_progress(RawImport *i) {
if (!ratelimit_below(&i->progress_ratelimit))
return;

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_info("Imported %u%%.", percent);

i->last_percent = percent;
Expand Down
2 changes: 1 addition & 1 deletion src/import/import-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void tar_import_report_progress(TarImport *i) {
if (!ratelimit_below(&i->progress_ratelimit))
return;

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_info("Imported %u%%.", percent);

i->last_percent = percent;
Expand Down
2 changes: 1 addition & 1 deletion src/import/importd.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ static int manager_on_notify(sd_event_source *s, int fd, uint32_t revents, void

r = parse_percent(p);
if (r < 0) {
log_warning("Got invalid percent value, ignoring.");
log_warning("Got invalid percent value '%s', ignoring.", p);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/import/pull-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void raw_pull_report_progress(RawPull *i, RawProgress p) {
assert_not_reached();
}

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_debug("Combined progress %u%%", percent);
}

Expand Down
2 changes: 1 addition & 1 deletion src/import/pull-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void tar_pull_report_progress(TarPull *i, TarProgress p) {
assert_not_reached();
}

sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);
sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent);
log_debug("Combined progress %u%%", percent);
}

Expand Down
1 change: 1 addition & 0 deletions src/systemctl/systemctl-show.c
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@ static int show_one(
bool *ellipsized) {

static const struct bus_properties_map property_map[] = {
{ "Id", "s", NULL, offsetof(UnitStatusInfo, id) },
{ "LoadState", "s", NULL, offsetof(UnitStatusInfo, load_state) },
{ "ActiveState", "s", NULL, offsetof(UnitStatusInfo, active_state) },
{ "FreezerState", "s", NULL, offsetof(UnitStatusInfo, freezer_state) },
Expand Down
7 changes: 4 additions & 3 deletions test/test-functions
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ run_qemu() {

local CONSOLE=ttyS0

# Reset the boot counter, if present
rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"
rm -f "$initdir"/{testok,failed,skipped}
# make sure the initdir is not mounted to avoid concurrent access
cleanup_initdir
Expand Down Expand Up @@ -645,6 +647,8 @@ run_qemu() {
# success), or 1 if nspawn is not available.
run_nspawn() {
[[ -d /run/systemd/system ]] || return 1
# Reset the boot counter, if present
rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"
rm -f "${initdir:?}"/{testok,failed,skipped}

local nspawn_cmd=()
Expand Down Expand Up @@ -3356,9 +3360,6 @@ test_run() {
local test_id="${1:?}"
mount_initdir

# Reset the boot counter, if present
rm -f "${initdir:?}/var/tmp/.systemd_reboot_count"

if ! get_bool "${TEST_NO_QEMU:=}"; then
if run_qemu "$test_id"; then
check_result_qemu || { echo "qemu test failed"; return 1; }
Expand Down
1 change: 0 additions & 1 deletion test/units/testsuite-44.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ [email protected] [email protected]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
LogTarget=foobar
2 changes: 1 addition & 1 deletion test/units/testsuite-64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ EOF
udevadm wait --settle --timeout=30 "/dev/disk/by-uuid/deadbeef-dead-dead-beef-11111111111$i" "/dev/disk/by-label/encdisk$i"
# Add the device into /etc/crypttab, reload systemd, and then activate
# the device so we can create a filesystem on it later
echo "encbtrfs$i UUID=deadbeef-dead-dead-beef-11111111111$i /etc/btrfs_keyfile luks,noearly" >>/etc/crypttab
echo "encbtrfs$i UUID=deadbeef-dead-dead-beef-11111111111$i /etc/btrfs_keyfile luks" >>/etc/crypttab
systemctl daemon-reload
systemctl start "systemd-cryptsetup@encbtrfs$i"
done
Expand Down

0 comments on commit 54f3b3d

Please sign in to comment.