Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 19 additions & 31 deletions test/system/211-dbus.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2023 – 2024 Red Hat, Inc.
# Copyright © 2023 – 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,14 +21,30 @@ load 'libs/bats-support/load'
load 'libs/bats-assert/load'
load 'libs/helpers'

setup() {
setup_file() {
bats_require_minimum_version 1.10.0
_setup_environment
cleanup_all
pushd "$HOME" || return 1

if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "arch" >/dev/null 2>/dev/null; then
create_distro_container arch latest arch-toolbox-latest
fi

if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "fedora" >/dev/null 2>/dev/null; then
create_default_container
create_distro_container fedora 34 fedora-toolbox-34
create_distro_container rhel 8.10 rhel-toolbox-8.10
fi

if echo "$TOOLBX_TEST_SYSTEM_TAGS" | grep "ubuntu" >/dev/null 2>/dev/null; then
create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04
create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04
create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04
fi
}

teardown() {
teardown_file() {
popd || return 1
cleanup_all
}
Expand All @@ -42,8 +58,6 @@ teardown() {
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

create_default_container

run --keep-empty-lines --separate-stderr "$TOOLBX" run gdbus call \
--session \
--dest org.freedesktop.DBus \
Expand All @@ -67,8 +81,6 @@ teardown() {
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

create_distro_container arch latest arch-toolbox-latest

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro arch \
gdbus call \
Expand All @@ -94,8 +106,6 @@ teardown() {
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

create_distro_container fedora 34 fedora-toolbox-34

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro fedora \
--release 34 \
Expand All @@ -122,8 +132,6 @@ teardown() {
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

create_distro_container rhel 8.10 rhel-toolbox-8.10

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro rhel \
--release 8.10 \
Expand All @@ -145,8 +153,6 @@ teardown() {
@test "dbus: session bus inside Ubuntu 16.04" {
busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer Ping

create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 16.04 \
Expand All @@ -165,8 +171,6 @@ teardown() {
@test "dbus: session bus inside Ubuntu 18.04" {
busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer Ping

create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 18.04 \
Expand All @@ -185,8 +189,6 @@ teardown() {
@test "dbus: session bus inside Ubuntu 20.04" {
busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer Ping

create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 20.04 \
Expand All @@ -212,8 +214,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_default_container

run --keep-empty-lines --separate-stderr "$TOOLBX" run gdbus call \
--system \
--dest org.freedesktop.systemd1 \
Expand Down Expand Up @@ -241,8 +241,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container arch latest arch-toolbox-latest

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro arch \
gdbus call \
Expand Down Expand Up @@ -272,8 +270,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container fedora 34 fedora-toolbox-34

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro fedora \
--release 34 \
Expand Down Expand Up @@ -304,8 +300,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container rhel 8.10 rhel-toolbox-8.10

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro rhel \
--release 8.10 \
Expand Down Expand Up @@ -334,8 +328,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 16.04 \
Expand All @@ -362,8 +354,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 18.04 \
Expand All @@ -390,8 +380,6 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04

run --keep-empty-lines --separate-stderr "$TOOLBX" run \
--distro ubuntu \
--release 20.04 \
Expand Down