Skip to content

Commit dd55c3c

Browse files
authored
* Fix 2.9/2.10 cloud * Fix splunk callback tests. * ansible_virtualization_type on AZP can be one of container/containerd instead of docker for dockerized tests. * Disable nomad tests. * Work around AZP bugs.
1 parent 33126b7 commit dd55c3c

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

.azure-pipelines/azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,20 @@ stages:
273273
jobs:
274274
- template: templates/matrix.yml
275275
parameters:
276-
nameFormat: Python 3.6 {0}
277-
testFormat: 2.10/cloud/3.6/{0}/1
276+
nameFormat: Python {0}
277+
testFormat: 2.10/cloud/{0}/1
278278
targets:
279-
- test: ''
279+
- test: 3.6
280280
- stage: Cloud_2_9
281281
displayName: Cloud 2.9
282282
dependsOn: []
283283
jobs:
284284
- template: templates/matrix.yml
285285
parameters:
286-
nameFormat: Python 3.6 {0}
287-
testFormat: 2.9/cloud/3.6/{0}/1
286+
nameFormat: Python {0}
287+
testFormat: 2.9/cloud/{0}/1
288288
targets:
289-
- test: ''
289+
- test: 3.6
290290
- stage: Summary
291291
condition: succeededOrFailed()
292292
dependsOn:

tests/integration/targets/filesystem/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- 'not (item.0.key == "btrfs" and (ansible_distribution == "Ubuntu" and ansible_distribution_release == "trusty"))'
3434
- 'not (item.0.key == "btrfs" and (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version("8", ">=")))'
3535
- 'not (item.0.key == "lvm" and ansible_system == "FreeBSD")' # LVM not available on FreeBSD
36-
- 'not (item.0.key == "lvm" and ansible_virtualization_type == "docker")' # Tests use losetup which can not be used inside unprivileged container
36+
- 'not (item.0.key == "lvm" and ansible_virtualization_type in ["docker", "container", "containerd"])' # Tests use losetup which can not be used inside unprivileged container
3737
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")' # ocfs2 only available on Debian based distributions
3838
- 'not (item.0.key == "f2fs" and ansible_system == "FreeBSD")'
3939
# f2fs-tools package not available with RHEL/CentOS

tests/integration/targets/nomad/aliases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ destructive
44
skip/aix
55
skip/centos6
66
skip/freebsd
7+
disabled # FIXME

tests/unit/plugins/callback/test_splunk.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626

2727
class TestSplunkClient(unittest.TestCase):
28-
def setUp(self):
28+
@patch('ansible_collections.community.general.plugins.callback.splunk.socket')
29+
def setUp(self, mock_socket):
30+
mock_socket.gethostname.return_value = 'my-host'
31+
mock_socket.gethostbyname.return_value = '1.2.3.4'
2932
self.splunk = SplunkHTTPCollectorSource()
3033
self.mock_task = Mock('MockTask')
3134
self.mock_task._role = 'myrole'
@@ -46,6 +49,8 @@ def test_timestamp_with_milliseconds(self, open_url_mock, mock_datetime):
4649
sent_data = json.loads(args[1])
4750

4851
self.assertEqual(sent_data['event']['timestamp'], '2020-12-01 00:00:00.000000 +0000')
52+
self.assertEqual(sent_data['event']['host'], 'my-host')
53+
self.assertEqual(sent_data['event']['ip_address'], '1.2.3.4')
4954

5055
@patch('ansible_collections.community.general.plugins.callback.splunk.datetime')
5156
@patch('ansible_collections.community.general.plugins.callback.splunk.open_url')
@@ -59,3 +64,5 @@ def test_timestamp_without_milliseconds(self, open_url_mock, mock_datetime):
5964
sent_data = json.loads(args[1])
6065

6166
self.assertEqual(sent_data['event']['timestamp'], '2020-12-01 00:00:00 +0000')
67+
self.assertEqual(sent_data['event']['host'], 'my-host')
68+
self.assertEqual(sent_data['event']['ip_address'], '1.2.3.4')

tests/utils/shippable/shippable.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function join {
1414
echo "$*";
1515
}
1616

17+
# Ensure we can write other collections to this dir
18+
sudo chown "$(whoami)" "${PWD}/../../"
19+
1720
test="$(join / "${args[@]:1}")"
1821

1922
docker images ansible/ansible

0 commit comments

Comments
 (0)