mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-19 01:17:00 +00:00
Install pygobject and NetworkManager-libnm if possible
This avoids skipping tests that require pygobject/libnm
This commit is contained in:
parent
fa13ea2388
commit
8157a89456
1 changed files with 31 additions and 4 deletions
|
|
@ -1,5 +1,19 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
---
|
||||
- hosts: all
|
||||
name: Setup for test running
|
||||
tasks:
|
||||
# FIXME: change with_items to loop when test-harness is updated
|
||||
- package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
ignore_errors: true
|
||||
with_items:
|
||||
- NetworkManager-libnm
|
||||
- python2-gobject-base
|
||||
- python3-gobject-base
|
||||
- python-gobject-base
|
||||
|
||||
- hosts: all
|
||||
name: execute python unit tests
|
||||
tasks:
|
||||
|
|
@ -28,9 +42,9 @@
|
|||
ignore_errors: true
|
||||
register: python2_available
|
||||
|
||||
- command: python2 /tmp/test-unit-1/test_network_connections.py
|
||||
- command: python2 /tmp/test-unit-1/test_network_connections.py --verbose
|
||||
when: python2_available | succeeded
|
||||
|
||||
register: python2_result
|
||||
|
||||
- package:
|
||||
name: python3
|
||||
|
|
@ -38,8 +52,21 @@
|
|||
ignore_errors: true
|
||||
register: python3_available
|
||||
|
||||
- command: python3 /tmp/test-unit-1/test_network_connections.py
|
||||
- command: python3 /tmp/test-unit-1/test_network_connections.py --verbose
|
||||
when: python3_available | succeeded
|
||||
register: python3_result
|
||||
|
||||
- command: python /tmp/test-unit-1/test_network_connections.py --verbose
|
||||
register: python_result
|
||||
|
||||
- command: python /tmp/test-unit-1/test_network_connections.py
|
||||
- debug:
|
||||
var: python2_result.stderr_lines
|
||||
when: python2_result is succeeded
|
||||
|
||||
- debug:
|
||||
var: python3_result.stderr_lines
|
||||
when: python3_result is succeeded
|
||||
|
||||
- debug:
|
||||
var: python_result.stderr_lines
|
||||
when: python_result is succeeded
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue