avocado-framework / avocado

Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
https://avocado-framework.github.io/
Other
345 stars 343 forks source link

apt unit test failing when running on > Ubuntu 24.04 or debian sid #6028

Open dnegreira opened 2 months ago

dnegreira commented 2 months ago

Describe the bug

As part of the packaging effort for Debian on https://github.com/avocado-framework/avocado/pull/5912, we have found that a unit test is failing on more recent distro versions of Ubuntu/Debian.

RESULTS    : PASS 654 | ERROR 0 | FAIL 1 | SKIP 23 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 70.23 s
Log file "debug.log" content for test "unit-644-selftests/unit/utils/software_manager.py:Apt.test_provides" (FAIL):
[stdout] ======================================================================
[stdout] FAIL: test_provides (software_manager.Apt.test_provides)
[stdout] ----------------------------------------------------------------------
[stdout] Traceback (most recent call last):
[stdout]   File "/root/git/avocado/selftests/unit/utils/software_manager.py", line 21, in test_provides
[stdout]     self.assertEqual(sm.provides("/bin/login"), "login")
[stdout] AssertionError: None != 'login'
[stdout] 
[stdout] ----------------------------------------------------------------------
[stdout] Ran 1 test in 6.036s
[stdout] 
[stdout] FAILED (failures=1)

This is because on more recent distros, the login package does not install on /bin/login but rather on /usr/bin/login

╰─$ dpkg -S login | grep /bin/login
systemd: /usr/bin/loginctl
login: /usr/bin/login

Steps to reproduce Run the unit tests on a Ubuntu 24.04 or Debian/sid distro.

Expected behavior Unit test to pass.

Current behavior Error.

System information (please complete the following information):

and

╰─$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:    24.04
Codename:   noble

Additional information I am currently working on fixing the unit test for code review, will submit it in a bit.