Skip to content

tests: mock LXD datasource detection in ds-identify on LXD containers#1178

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
blackboxsw:tests-ds-identify-mock-lxd-false
Jan 10, 2022
Merged

tests: mock LXD datasource detection in ds-identify on LXD containers#1178
TheRealFalcon merged 1 commit into
canonical:mainfrom
blackboxsw:tests-ds-identify-mock-lxd-false

Conversation

@blackboxsw
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw commented Jan 10, 2022

Proposed Commit Message

On LXD containers /dev/lxd/sock will always exist.

Mock dscheck_LXD to return 1 (NOT_FOUND) to avoid leaking into
test environment and returning LXD as detected.

We have integration tests covering proper LXD datasource detection
so we don't need a Unit test validating the [ -S /dev/lxd/sock] that
is in ds-identify.

Additional Context

Test Steps

lxc launch ubuntu-daily:bionic dev-b
lxc config device add dev-b rohome disk source="/home/csmith/src/cloud-init" path="/root/cloud-init/"
lxc exec dev-b bash
tox -e py3 tests/unittests/test_ds_identify.py

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

On LXD containers /dev/lxd/sock will always exist.

Mock dscheck_LXD to return 1 (NOT_FOUND) to avoid leaking into
test environment and returning LXD as detected.

We have integration tests covering proper LXD datasource detection
so we don't need a Unit test validating the [ -S /dev/lxd/sock] that
is in ds-identify.
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheRealFalcon TheRealFalcon merged commit 57ccd89 into canonical:main Jan 10, 2022
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.

2 participants