@@ -189,18 +189,19 @@ rlJournalStart
189
189
# Check the rarities in the test attributes/parameters
190
190
if [[ $jq_element == attributes ]]; then
191
191
key=" contact"
192
+
192
193
value=" $( yq -r " .\" $test_name \" .$key " test.fmf) "
193
194
if [[ $value != null ]]; then
194
- # TODO: Fix the test here! The output of yq is list of
195
- # contact in the case of multiple contacts (test==/bad)
196
- # and a string in a case when one contact is provided
197
- # for the test (test==/good). We must somehow handle
198
- # both situations.
199
- #
200
- # If yq returns list, we must check both contacts in the response JSON
201
- # If yq returns just a string value, we must check only one contact in the response JSON
195
+ if [[ " $value " == * " ," * ]]; then
196
+ # Get the contact items as CSV (separated by a comma)
197
+ value=" $( yq -r " . | @csv" <<< $value ) "
198
+ fi
202
199
rlAssertGrep " $key " tmp_attributes.json -A1 > tmp_attributes_selection
203
- rlAssertGrep " $value " tmp_attributes_selection
200
+
201
+ IFS=, read -r -a contact_items <<< " $value"
202
+ for contact_item in " ${contact_items[@]} " ; do
203
+ rlAssertGrep " $contact_item " tmp_attributes_selection
204
+ done
204
205
else
205
206
rlAssertNotGrep " $key " tmp_attributes.json
206
207
fi
@@ -209,10 +210,6 @@ rlJournalStart
209
210
rlAssertNotGrep " $key " tmp_attributes.json
210
211
fi
211
212
212
- # REMOVE ME: just for testing
213
- # echo "EXITING OMG"
214
- # exit 99
215
-
216
213
rm tmp_attributes*
217
214
done
218
215
0 commit comments