Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Jan 18, 2025
1 parent 9fa4e3e commit 1ceef90
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 91 deletions.
59 changes: 1 addition & 58 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- docs-master

env:
#ANSIBLE_VERBOSITY: 3
ANSIBLE_VERBOSITY: 3
#MITOGEN_LOG_LEVEL: DEBUG
MITOGEN_TEST_IMAGE_TEMPLATE: "ghcr.io/mitogen-hq/%(distro)s-test"

Expand All @@ -29,57 +29,6 @@ jobs:
- name: Ans_27_4
tox_env: py27-mode_ansible-ansible4

- name: Ans_36_210
python_version: '3.6'
tox_env: py36-mode_ansible-ansible2.10
- name: Ans_36_4
python_version: '3.6'
tox_env: py36-mode_ansible-ansible4

- name: Ans_311_210
python_version: '3.11'
tox_env: py311-mode_ansible-ansible2.10
- name: Ans_311_3
python_version: '3.11'
tox_env: py311-mode_ansible-ansible3
- name: Ans_311_4
python_version: '3.11'
tox_env: py311-mode_ansible-ansible4
- name: Ans_311_5
python_version: '3.11'
tox_env: py311-mode_ansible-ansible5
- name: Ans_313_6
python_version: '3.13'
tox_env: py313-mode_ansible-ansible6
- name: Ans_313_7
python_version: '3.13'
tox_env: py313-mode_ansible-ansible7
- name: Ans_313_8
python_version: '3.13'
tox_env: py313-mode_ansible-ansible8
- name: Ans_313_9
python_version: '3.13'
tox_env: py313-mode_ansible-ansible9
- name: Ans_313_10
python_version: '3.13'
tox_env: py313-mode_ansible-ansible10
- name: Ans_313_11
python_version: '3.13'
tox_env: py313-mode_ansible-ansible11

- name: Van_313_11
python_version: '3.13'
tox_env: py313-mode_ansible-ansible11-strategy_linear

- name: Mito_27
tox_env: py27-mode_mitogen
- name: Mito_36
python_version: '3.6'
tox_env: py36-mode_mitogen
- name: Mito_313
python_version: '3.13'
tox_env: py313-mode_mitogen

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -171,12 +120,6 @@ jobs:
- name: Mito_313
tox_env: py313-mode_mitogen

- name: Loc_313_11
tox_env: py313-mode_localhost-ansible11

- name: Van_313_11
tox_env: py313-mode_localhost-ansible11-strategy_linear

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
15 changes: 0 additions & 15 deletions tests/ansible/regression/all.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
- import_playbook: issue_109__target_has_old_ansible_installed.yml
- import_playbook: issue_113__duplicate_module_imports.yml
- import_playbook: issue_118__script_not_marked_exec.yml
- import_playbook: issue_122__environment_difference.yml
- import_playbook: issue_140__thread_pileup.yml
- import_playbook: issue_152__local_action_wrong_interpreter.yml
- import_playbook: issue_152__virtualenv_python_fails.yml
- import_playbook: issue_154__module_state_leaks.yml
- import_playbook: issue_177__copy_module_failing.yml
- import_playbook: issue_332_ansiblemoduleerror_first_occurrence.yml
- import_playbook: issue_558_unarchive_failed.yml
- import_playbook: issue_590__sys_modules_crap.yml
- import_playbook: issue_591__setuptools_cwd_crash.yml
- import_playbook: issue_615__streaming_transfer.yml
- import_playbook: issue_655__wait_for_connection_error.yml
- import_playbook: issue_766__get_with_context.yml
- import_playbook: issue_776__load_plugins_called_twice.yml
- import_playbook: issue_952__ask_become_pass.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
tasks:
- meta: end_play
when:
# Podman versions available in Homebrew have dropped macOS 12 support.
# Podman versions available in Homebrew support macOS 13+ (Ventura).
# https://formulae.brew.sh/formula/podman
- ansible_facts.system == 'Darwin'
- ansible_facts.distribution_version is version('13.0', '<', strict=True)

Expand Down
53 changes: 36 additions & 17 deletions tests/ansible/regression/issue_766__get_with_context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,58 @@
---
- name: regression/issue_766__get_with_context.yml
hosts: localhost
# Gather facts to use *and* to trigger any "could not recover task_vars" error
# https://github.com/mitogen-hq/mitogen/pull/1215#issuecomment-2596421111
gather_facts: true
vars:
netconf_container_image: ghcr.io/mitogen-hq/sysrepo-netopeer2:latest
netconf_container_name: sysprep
netconf_container_port: 8030
tasks:
- meta: end_play
when:
- ansible_facts.system == 'Darwin'

- block:
- name: Start container
delegate_to: localhost
vars:
ansible_port: 8040
containers.podman.podman_container:
name: sysprep
image: ghcr.io/mitogen-hq/sysrepo-netopeer2:latest
auto_remove: true
detach: true
recreate: true
published_ports:
- "{{ ansible_port }}:830"
command:
cmd: >-
podman run
--name "{{ netconf_container_name }}"
--detach
--rm
--publish "{{ netconf_container_port }}:830"
"{{ netconf_container_image }}"
changed_when: true

- name: Wait for container
delegate_to: localhost
# TODO robust condition. wait_for + search_regex? wait_for_connection?
wait_for:
timeout: 5

- name: Get running configuration and state data
vars:
ansible_port: 8040
ansible_port: "{{ netconf_container_port }}"
ansible_connection: netconf
ansible_user: netconf
ansible_password: netconf
ansible_host_key_checking: false
ansible_netconf_proxy_command: >-
ssh
-o HostKeyAlgorithms=+ssh-rsa
-o PubkeyAcceptedKeyTypes=+ssh-rsa
-o StrictHostKeyChecking=no
-p %p
%r@%h
ansible.netcommon.netconf_get:

always:
- name: Cleanup container
delegate_to: localhost
containers.podman.podman_container:
name: sysprep
state: absent
command:
cmd: "{{ item.cmd }}"
loop:
- cmd: podman stop "{{ netconf_container_name }}"
- cmd: podman rm "{{ netconf_container_name }}"
changed_when: true
tags:
- issue_766

0 comments on commit 1ceef90

Please sign in to comment.