#!/bin/bash
product_list_file=$1
echo "inside registrar_test"

IFS=","

while read product; do
    docker exec -i $(docker ps -qf "name=emg-pvs_registrar") \
        python3 /registrar.py \
            --objects-prefix $product \
            --service-url $SERVICE_URL \
            --reporting-dir "/mnt/reports" \
            <<<$product

done < "$product_list_file"

pytest
if [ $? -ne 0 ]; then echo "Pytest fail" >&2 && exit 1; fi