Skip to content

Commit fbc12ec

Browse files
committed
Fixed broken tests, esp. those broken by the change from PolicyNotAuthorized -> HTTPForbidden errors
1 parent f28e6f5 commit fbc12ec

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

tests/functional/test-lessee-id.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ echo "OFFER CLAIM INVALID USER TEST"
4343

4444
openstack --os-cloud test1-subproject-1 esi offer claim $test_offer_uuid -f shell > $tmpfile 2> $errfile
4545
ec=$?
46-
expected_error='esi_leap:offer:offer_admin is disallowed by policy'
46+
expected_error="Access was denied to offer $test_offer_uuid."
4747

4848
if ! grep -q "$expected_error" $errfile; then
4949
if [[ $ec -eq 0 ]]; then

tests/functional/test-no-lessee-id.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ end=$(date -d "+5 days" +%Y-%m-%d)
77

88
# Setup script, contains offer create test
99

10-
./setup.sh $tmpfile $project_id $start $end $resource_type
10+
./setup.sh $tmpfile $project_id $start $end
1111

1212
. $tmpfile
1313

@@ -28,7 +28,7 @@ openstack --os-cloud test1 esi offer create \
2828
$node_uuid \
2929
--start-time $start \
3030
--end-time $end \
31-
--resource-type $resource_type \
31+
--resource-type dummy_node \
3232
-f shell > $tmpfile 2> $errfile
3333
ec=$?
3434
expected_error="Time conflict for dummy_node $node_uuid."

tests/functional/test-no-offer.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ openstack --os-cloud test2 esi offer create \
7676
--resource-type dummy_node \
7777
-f shell > $tmpfile 2> $errfile
7878
ec=$?
79-
expected_error="esi_leap:offer:offer_admin is disallowed by policy"
79+
expected_error="Access was denied to dummy_node $node_uuid."
8080

8181
if ! cat $errfile | grep -q "$expected_error"; then
8282
if [[ $ec -eq 0 ]]; then
@@ -109,7 +109,7 @@ openstack --os-cloud test2 esi lease create \
109109
--resource-type dummy_node \
110110
-f shell > $tmpfile 2> $errfile
111111
ec=$?
112-
expected_error="esi_leap:offer:offer_admin is disallowed by policy"
112+
expected_error="Access was denied to dummy_node $node_uuid."
113113

114114
if ! cat $errfile | grep -q "$expected_error"; then
115115
if [[ $ec -eq 0 ]]; then

tests/functional/test-offer-expire.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ end=$(date -d "+1 minute" +"%Y-%m-%d %H:%M:%S")
1414
# The uuid variable will be overwritten, so we save it here
1515
test_offer_uuid=$uuid
1616
# Run cleanup if the script exits, contains offer delete test
17+
# Note: deletion will fail if handling of expired offers works
1718
trap "./cleanup.sh $test_offer_uuid; rm -f $tmpfile $errfile $nodefile" EXIT
1819

19-
sleep 2m
20-
date +"%Y-%m-%D %H:%M:%S"
21-
2220
###################################
2321
## OFFER LIST EXPIRED OFFER TEST ##
2422
###################################
2523

2624
echo "OFFER LIST EXPIRED OFFER TEST"
2725

26+
sleep 2m
27+
date +"%Y-%m-%D %H:%M:%S"
28+
2829
openstack --os-cloud test1-subproject esi offer list -f json > $tmpfile \
2930
|| { ec=$?; echo "ERROR: failed to list offers" >&2; exit $ec; }
3031
cat $tmpfile

0 commit comments

Comments
 (0)