Skip to content

tests/cmd/query: fix test run as root and add coverage for defaults#1156

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:fix-query-test
Dec 14, 2021
Merged

tests/cmd/query: fix test run as root and add coverage for defaults#1156
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:fix-query-test

Conversation

@cjp256
Copy link
Copy Markdown
Contributor

@cjp256 cjp256 commented Dec 14, 2021

test_handle_args_error_on_invalid_vaname_paths() would fail when run
as root due to invocation of load_userdata() on the default user/vendor
data locations under the instance link.

  • Mock load_userdata() for this test case to avoid loads.
  • Update _setup_paths() to configure cloud_dir in temporary location.
  • Add new test case to verify that the default locations are loaded
    when unspecified.

Signed-off-by: Chris Patterson cpatterson@microsoft.com

test_handle_args_error_on_invalid_vaname_paths() would fail when run
as root due to invocation of load_userdata() on the default user/vendor
data locations under the instance link.

- Mock load_userdata() for this test case to avoid loads.
- Update _setup_paths() to configure cloud_dir in temporary location.
- Add new test case to verify that the default locations are loaded
  when unspecified.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
@anhvoms
Copy link
Copy Markdown
Contributor

anhvoms commented Dec 14, 2021

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 3da3bda into canonical:main Dec 14, 2021
@cjp256 cjp256 deleted the fix-query-test branch December 14, 2021 16:58
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