Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add other combinations to test Dbus #1376

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

nievesmontero
Copy link
Collaborator

Dbus is only run in the default container. We want to add more tests in order to run it on different OS.

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/69da4594f802420ca266bad1ebfe9a75

✔️ unit-test SUCCESS in 8m 44s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 12s
✔️ unit-test-restricted SUCCESS in 7m 36s
system-test-fedora-rawhide FAILURE in 33m 42s
system-test-fedora-38 FAILURE in 25m 24s
system-test-fedora-37 FAILURE in 25m 13s

Copy link
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this pull request ready? I am asking because all the newly added tests are failing:

fedora-38 | not ok 266 dbus: session bus inside Ubuntu 16.04 in 1750ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 108)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : ()
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 267 dbus: system bus inside Ubuntu 16.04 in 1993ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 138)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : (<'253.10-1.fc38'>,)
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 268 dbus: session bus inside Ubuntu 18.04 in 1804ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 167)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : ()
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 269 dbus: system bus inside Ubuntu 18.04 in 1761ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 197)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : (<'253.10-1.fc38'>,)
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | # test suite: Tear down
fedora-38 | ERROR
fedora-38 | {
fedora-38 |   "delta": "0:16:41.342908",
fedora-38 |   "end": "2023-09-25 12:44:17.449838",
fedora-38 |   "msg": "non-zero return code",
fedora-38 |   "rc": 1,
fedora-38 |   "start": "2023-09-25 12:27:36.106930"
fedora-38 | }

@nievesmontero
Copy link
Collaborator Author

Is this pull request ready? I am asking because all the newly added tests are failing:

fedora-38 | not ok 266 dbus: session bus inside Ubuntu 16.04 in 1750ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 108)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : ()
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 267 dbus: system bus inside Ubuntu 16.04 in 1993ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 138)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : (<'253.10-1.fc38'>,)
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 268 dbus: session bus inside Ubuntu 18.04 in 1804ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 167)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : ()
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | not ok 269 dbus: system bus inside Ubuntu 18.04 in 1761ms
fedora-38 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 488,
fedora-38 | #  in test file test/system/211-dbus.bats, line 197)
fedora-38 | #   `assert_line --index 0 "$expected_response"' failed
fedora-38 | #
fedora-38 | # -- line differs --
fedora-38 | # index    : 0
fedora-38 | # expected : (<'253.10-1.fc38'>,)
fedora-38 | # actual   :
fedora-38 | # --
fedora-38 | #
fedora-38 | # test suite: Tear down
fedora-38 | ERROR
fedora-38 | {
fedora-38 |   "delta": "0:16:41.342908",
fedora-38 |   "end": "2023-09-25 12:44:17.449838",
fedora-38 |   "msg": "non-zero return code",
fedora-38 |   "rc": 1,
fedora-38 |   "start": "2023-09-25 12:27:36.106930"
fedora-38 | }

Not yet. I'm still working on it. I pushed it in order to check whether the failures were the same as the ones I was obtaining locally.

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/f3378cdc7e4f451fa34b91b3691ceebd

✔️ unit-test SUCCESS in 8m 53s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 28s
✔️ unit-test-restricted SUCCESS in 7m 48s
system-test-fedora-rawhide FAILURE in 37m 20s
✔️ system-test-fedora-38 SUCCESS in 27m 21s
✔️ system-test-fedora-37 SUCCESS in 26m 46s

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/56b34f08b5f34518978021476b164a7e

✔️ unit-test SUCCESS in 8m 50s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 50s
✔️ unit-test-restricted SUCCESS in 7m 47s
system-test-fedora-rawhide FAILURE in 38m 18s
system-test-fedora-39 FAILURE in 37m 45s
✔️ system-test-fedora-38 SUCCESS in 32m 01s
✔️ system-test-fedora-37 SUCCESS in 29m 18s

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/f1482bec7de949ddb1546ebdaa379d42

unit-test RETRY_LIMIT in 8m 15s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 23s
unit-test-restricted RETRY_LIMIT in 5m 44s
system-test-fedora-rawhide RETRY_LIMIT in 8m 05s
system-test-fedora-39 RETRY_LIMIT in 8m 14s
system-test-fedora-38 RETRY_LIMIT in 8m 11s
system-test-fedora-37 RETRY_LIMIT in 8m 12s

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/8384fce8010d4259b49e1076e08d901d

unit-test RETRY_LIMIT in 8m 07s
unit-test-migration-path-for-coreos-toolbox RETRY_LIMIT in 2m 07s
unit-test-restricted RETRY_LIMIT in 5m 44s
system-test-fedora-rawhide RETRY_LIMIT in 8m 00s
system-test-fedora-39 RETRY_LIMIT in 8m 09s
system-test-fedora-38 RETRY_LIMIT in 8m 10s
system-test-fedora-37 RETRY_LIMIT in 7m 31s

@softwarefactory-project-zuul
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/e10eef4a60cb4d86a6fa7c72e846d0b0

✔️ unit-test SUCCESS in 8m 23s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 31s
✔️ unit-test-restricted SUCCESS in 7m 35s
system-test-fedora-rawhide FAILURE in 36m 38s
system-test-fedora-39 FAILURE in 35m 46s
✔️ system-test-fedora-38 SUCCESS in 28m 19s
✔️ system-test-fedora-37 SUCCESS in 27m 22s

Copy link
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this pull request, @nievesmontero ! Did you delete test/system/220-environment-variables.bats by mistake?

test/system/211-dbus.bats Outdated Show resolved Hide resolved
test/system/meson.build Outdated Show resolved Hide resolved
@nievesmontero
Copy link
Collaborator Author

Thanks for updating this pull request, @nievesmontero ! Did you delete test/system/220-environment-variables.bats by mistake?

I did a rebase by mistake, and after that all the tests were failing, that's why I removed those new files from my branch. Anyway, it was just to see if the tests were failing the same without them, and apparently after removing them, only the fedora rawhide and 39 are failing.

Copy link
Member

@HarryMichal HarryMichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice set of tests! We definitely want these. Just a few points to resolve and this should be good to go. Also, make sure to revert the removal of the 220-environment-variables.bats file. This can't be merged otherwise.

Comment on lines 93 to 103
expected_response="$(gdbus call \
--session \
--dest org.freedesktop.DBus \
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro arch sh -c 'gdbus call \
--session \
--dest org.freedesktop.DBus \
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands seem to reoccur regularly. Putting them into a global variable could prevent a potential typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes a lot of sense. If @debarshiray agrees, I can create two global variables, one for the session bus and another for the system bus.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Feel free to submit a pull request.

Comment on lines 120 to 131
expected_response="$(gdbus call \
--system \
--dest org.freedesktop.systemd1 \
--object-path /org/freedesktop/systemd1 \
--method org.freedesktop.DBus.Properties.Get org.freedesktop.systemd1.Manager Version)"

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro arch sh -c 'gdbus call \
--system \
--dest org.freedesktop.systemd1 \
--object-path /org/freedesktop/systemd1 \
--method org.freedesktop.DBus.Properties.Get \
org.freedesktop.systemd1.Manager Version'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation behind using org.freedesktop.DBus.Peer.Ping to only test the session bus and org.freedesktop.DBus.Properties.Get org.freedesktop.systemd1.Manager Version to only test the system bus? Can't we use the same method for both types of buses?

Having the same method for both could prevent potential problems if only of those methods were to break.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my quick testing on Fedora 38 Workstation, Get org.freedesktop.systemd1.Manager Version works for both the user and system buses, but Ping only works for the user bus because it leads to GDBus.Error:org.freedesktop.DBus.Error.AccessDenied for the system bus.

We could definitely include Get org.freedesktop.systemd1.Manager Version for the user bus tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to submit a pull request with Get org.freedesktop.systemd1.Manager Version for the user bus tests.

test/system/211-dbus.bats Outdated Show resolved Hide resolved
@nievesmontero nievesmontero force-pushed the more-dbus-tests branch 2 times, most recently from 31c0dbf to 4204f33 Compare November 2, 2023 11:42
Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/1164e7ca152a44f8a9eda81f3ddfc66c

✔️ unit-test SUCCESS in 8m 34s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 53s
✔️ unit-test-restricted SUCCESS in 8m 07s
system-test-fedora-rawhide FAILURE in 31m 15s
system-test-fedora-39 FAILURE in 30m 32s
system-test-fedora-38 FAILURE in 29m 19s
system-test-fedora-37 FAILURE in 29m 25s

Copy link

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/98ab482848684e8cad0c2c22903a5207

✔️ unit-test SUCCESS in 8m 26s
unit-test-migration-path-for-coreos-toolbox RETRY_LIMIT in 1m 36s
✔️ unit-test-restricted SUCCESS in 7m 12s
system-test-fedora-rawhide FAILURE in 28m 20s
system-test-fedora-39 FAILURE in 27m 10s
✔️ system-test-fedora-38 SUCCESS in 28m 14s
✔️ system-test-fedora-37 SUCCESS in 27m 36s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/e4326fb398454d1d8bdc45fed842c58b

✔️ unit-test SUCCESS in 8m 44s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 9m 53s
✔️ unit-test-restricted SUCCESS in 7m 40s
✔️ system-test-fedora-rawhide SUCCESS in 31m 28s
✔️ system-test-fedora-39 SUCCESS in 30m 16s
✔️ system-test-fedora-38 SUCCESS in 30m 33s
✔️ system-test-fedora-37 SUCCESS in 45m 21s

@debarshiray
Copy link
Member

Rebased on top of current main.

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/d9a7414ca18c433f9b3e576f6f7e59c3

✔️ unit-test SUCCESS in 9m 06s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 51s
✔️ unit-test-restricted SUCCESS in 7m 45s
✔️ system-test-fedora-rawhide SUCCESS in 35m 06s
✔️ system-test-fedora-39 SUCCESS in 34m 14s
✔️ system-test-fedora-38 SUCCESS in 34m 15s
✔️ system-test-fedora-37 SUCCESS in 33m 49s

test/system/211-dbus.bats Outdated Show resolved Hide resolved
test/system/211-dbus.bats Outdated Show resolved Hide resolved
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/0c09c3ebca8f4eb696cc62e9069a8de9

✔️ unit-test SUCCESS in 10m 15s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 5m 12s
✔️ unit-test-restricted SUCCESS in 8m 25s
✔️ system-test-fedora-rawhide SUCCESS in 35m 41s
✔️ system-test-fedora-39 SUCCESS in 34m 52s
✔️ system-test-fedora-38 SUCCESS in 34m 15s
✔️ system-test-fedora-37 SUCCESS in 34m 00s

test/system/211-dbus.bats Outdated Show resolved Hide resolved
test/system/211-dbus.bats Outdated Show resolved Hide resolved
test/system/211-dbus.bats Outdated Show resolved Hide resolved
test/system/211-dbus.bats Outdated Show resolved Hide resolved
Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/5497718dd2c7483dac07d3617cac4727

✔️ unit-test SUCCESS in 8m 55s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 28s
✔️ unit-test-restricted SUCCESS in 8m 10s
✔️ system-test-fedora-rawhide SUCCESS in 35m 00s
✔️ system-test-fedora-39 SUCCESS in 33m 05s
✔️ system-test-fedora-38 SUCCESS in 32m 59s
✔️ system-test-fedora-37 SUCCESS in 32m 57s

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/faa491b08f3f411780a07300396b0a6b

✔️ unit-test SUCCESS in 9m 25s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 31s
✔️ unit-test-restricted SUCCESS in 8m 59s
✔️ system-test-fedora-rawhide SUCCESS in 34m 18s
✔️ system-test-fedora-39 SUCCESS in 32m 41s
✔️ system-test-fedora-38 SUCCESS in 32m 26s
✔️ system-test-fedora-37 SUCCESS in 32m 36s

@debarshiray debarshiray merged commit 1318c9e into containers:main Nov 30, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants