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 nested lxc test to fully test the lxc_ssh.py plugin from ssh to lxc #40

Merged
merged 1 commit into from
Aug 2, 2021

Conversation

dmp1ce
Copy link

@dmp1ce dmp1ce commented Jun 11, 2021

Add nested lxc test thanks to the work of @AnvithLobo. This should fully test the lxc_ssh.py plugin.

I'm not sure the previous tests were testing lxc_ssh.py at all to be honest.

@AnvithLobo
Copy link

is there any reason to have this test ?

- hosts: all
become: no
gather_facts: True
any_errors_fatal: True
force_handlers: True
tasks:
- name: ping VM
ping:
- name: Test empty file
include_tasks:
file: "test-copy-fetch.yml"
vars:
filename: "test_empty"
- name: Test 1000 Bytes file
include_tasks:
file: "test-copy-fetch.yml"
vars:
filename: "test_1000b"
- name: Test 5MB file
include_tasks:
file: "test-copy-fetch.yml"
vars:
filename: "test_5mb"
- name: Test 50MB file
include_tasks:
file: "test-copy-fetch.yml"
vars:
filename: "test_50mb"
- name: Test command
include_tasks:
file: "test-command.yml"
vars:
expect_user: "root"
- name: Test template
include_tasks:
file: "test-template.yml"
vars:
filename: "test-template"

Since asible_user is by default root when you attach lxc. So become: yes / become: yes should not have any different effect here

@dmp1ce
Copy link
Author

dmp1ce commented Jun 11, 2021

I'm not sure. Does become do anything with the plugin?

@AnvithLobo
Copy link

AnvithLobo commented Jun 11, 2021

I'm not sure. Does become do anything with the plugin?

nope nothing since the default container user is root when you exec commands with lxc . I'm not yet sure if become_user works either. Still have to test that

@dmp1ce
Copy link
Author

dmp1ce commented Jun 11, 2021

Well, I'm happy to remove it or leave it in for future use.

Co-authored-by: David Parrish <daveparrish@tutanota.com>
Co-authored-by: AnvithLobo <64419387+AnvithLobo@users.noreply.github.com>
@dmp1ce
Copy link
Author

dmp1ce commented Jun 11, 2021

I removed the become: no section.

@andreasscherbaum
Copy link
Owner

@dmp1ce All the new tests are failing with ssh key problem.

@dmp1ce
Copy link
Author

dmp1ce commented Jun 24, 2021

@dmp1ce All the new tests are failing with ssh key problem.

That's right! Because the tests from this PR correctly show the state of lxc_ssh plugin. The #41 PR fixed the plugin so the tests pass.

@andreasscherbaum
Copy link
Owner

Based on discussion here I'm going to merge this PR, and then re-test #38.

@andreasscherbaum andreasscherbaum merged commit 6a9a493 into andreasscherbaum:master Aug 2, 2021
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