#!/bin/bash
product_list_file=$1

IFS=","
while read  product; do  

    docker exec -i $(docker ps -qf "name=emg-pvs_registrar") python3 python3 /registrar.py --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-register-queue-key ${REDIS_REGISTER_QUEUE_KEY} --redis-registered-set-key ${REDIS_REGISTERED_SET_KEY} --objects-prefix $product <<<$product
    
done < $product_list_file

pytest -s registrar_test.py --name $product_list_file
