canonical / canonical/cloud-init
FreeBSD: failing unit tests in tests/unittests/cmd/devel/test_logs.py
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
# Bug report
The tests in tests/unittests/cmd/devel/test_logs.py are written with GNU ls in mind.
On FreeBSD they produce the following errors:
```
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectLogs::test_write_command_output_to_file[cmd1-Unexpected error while running command.\nCommand: ['ls', '/nonexistent-directory']\nExit code: 2\nReason: -\nStdout: \nStderr: ls: cannot access '/nonexistent-directory': No such file or directory-None] - assert "Unexpected error while running command.\nCommand: ['ls', '/nonexistent-directory']\nExit code: 2\nReason: -\nStdout: \nStderr: ls: cannot access '/nonexistent-...
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectLogs::test_stream_command_output_to_file[cmd1-ls: cannot access '/nonexistent-directory': No such file or directory\n] - assert "ls: cannot access '/nonexistent-directory': No such file or directory\n" == 'ls: /nonexistent-directory: No such file or directory\n'
```
## Steps to reproduce the problem
on FreeBSD, run tests (preferably with a netlink patched python version)
Here's what `ls /nonexistent-directory` actually says on FreeBSD and Alpine (busybox):
```
$ ls /nonexistent-directory
ls: /nonexistent-directory: No such file or directory
$
```
## Environment details
- Cloud-init version: tip of main
- Operating System Distribution: FreeBSD 15.0-CURRENT
- Cloud provider, platform or installer type: -
Contributor guide
Assessment
This issue has not been assessed yet.