Fix test-matrix shebang for ansible 6

Ansible 6 interprets the shebang line to know what version of python to
run a module under. Unfortunately, this is at odds with using the
shebang line normally on a unix system to execte the module as a normal
script. Devstack-gate uses the test-matrix library in both ways as an
Ansible module and as a normal script. To reconcile the differences we
drop the shebang entirely to force Ansible to use a default
interpretation, and on the script side we force users to run the script
with the python they want explicitly.

This is not ideal, but there isn't a better way to reconcile the
difference in Ansible 6 expectations and using things as a normal
script.

Change-Id: I9a331d508276d9abe72c789fd91fc77a4136c5ca
This commit is contained in:
Clark Boylan 2022-10-11 07:57:28 -07:00
parent 2c891c51d5
commit 9cfd5cca0a
2 changed files with 6 additions and 8 deletions

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

View File

@ -46,37 +46,37 @@ function assert_list_equal {
function test_full_master {
local results
results=$(DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n)
results=$(DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n)
assert_list_equal $TEMPEST_FULL_MASTER $results
}
function test_full_feature_ec {
local results
results=$(DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n -b feature/ec)
results=$(DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n -b feature/ec)
assert_list_equal $TEMPEST_FULL_MASTER $results
}
function test_neutron_master {
local results
results=$(DEVSTACK_GATE_NEUTRON=1 DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n)
results=$(DEVSTACK_GATE_NEUTRON=1 DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n)
assert_list_equal $TEMPEST_NEUTRON_MASTER $results
}
function test_heat_slow_master {
local results
results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_NEUTRON=1 DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n)
results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_NEUTRON=1 DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n)
assert_list_equal $TEMPEST_HEAT_SLOW_MASTER $results
}
function test_grenade_new_master {
local results
results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n)
results=$(DEVSTACK_GATE_TEMPEST_HEAT_SLOW=1 DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n)
assert_list_equal $GRENADE_NEW_MASTER $results
}
function test_grenade_subnode_master {
local results
results=$(DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 ./roles/test-matrix/library/test_matrix.py -n -r subnode)
results=$(DEVSTACK_GATE_GRENADE=pullup DEVSTACK_GATE_TEMPEST=1 python ./roles/test-matrix/library/test_matrix.py -n -r subnode)
assert_list_equal $GRENADE_SUBNODE_MASTER $results
}