Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove uneeded subscription (when lua script ready) #172

Open
github-actions bot opened this issue Oct 27, 2022 · 0 comments
Open

remove uneeded subscription (when lua script ready) #172

github-actions bot opened this issue Oct 27, 2022 · 0 comments
Labels
enhancement New feature or request todo
Milestone

Comments

@github-actions
Copy link
Contributor

# TODO: THIS IS REQUIRED UNTIL WE DON'T INJECT SUBSCRITION IN LUA

echo ""
echo "Get metadata from node 1?"
echo "==============================================================="

export response=`curl -s -o /dev/null -w "%{http_code}" --request GET 'http://localhost:8098/metadata'`
if [ $response == "200" ]
then
  echo "PASSED"
else
  echo "ERROR: Can't get metadata"
  exit 1
fi

echo ""
echo "Get metadata from node 2?"
echo "==============================================================="

export response=`curl -s -o /dev/null -w "%{http_code}" --request GET 'http://localhost:8099/metadata'`
if [ $response == "200" ]
then
  echo "PASSED"
else
  echo "ERROR: Can't get metadata"
  exit 1
fi


# TODO: THIS IS REQUIRED UNTIL WE DON'T INJECT SUBSCRITION IN LUA
echo ""
echo "Can subscribe node 1 for urn:AirQuality:1? (destination tenant 1)"
echo "==============================================================="
export response=`curl -s -o /dev/null -w "%{http_code}" --request POST 'http://localhost:8098/resource/urn:AirQuality:1/subscribe' --header 'fiware-Service: Tenant1' --header 'fiware-Servicepath: /'`
if [ $response == "200" ]
then
  echo "PASSED"
else
  echo "ERROR: Can't subscribe"
  exit 1
fi

echo ""
echo "Can retrieve mobile data from node 2 for user admin@mail.com?"
echo "==============================================================="
export response=`curl -s -o /dev/null -w "%{http_code}" --request GET 'http://localhost:8099/mobile/policies' --header 'user: admin@mail.com'`
if [ $response == "200" ]
then
  echo "PASSED"
else
  echo "ERROR: Can't get mobile data"
  exit 1
fi

echo ""
echo "Node 1 has 3 policies for urn:AirQuality:1 in Tenant1"
echo "==============================================================="
export response=`curl -s -X 'GET' 'http://localhost:8085/v1/policies/?resource=urn%3AAirQuality%3A1&skip=0&limit=100' -H 'accept: application/json' -H 'fiware-service: Tenant1' -H 'fiware-servicepath: /#' | jq length`
if [ $response == "3" ]
then
  echo "PASSED"
else
  echo "ERROR"
  exit 1
fi

echo ""
echo "Node 2 has 0 policies for urn:AirQuality:1 in Tenant2"
echo "==============================================================="
export response=`curl -s -X 'GET' 'http://localhost:8086/v1/policies/?resource=urn%3AAirQuality%3A1&skip=0&limit=100' -H 'accept: application/json' -H 'fiware-service: Tenant2' -H 'fiware-servicepath: /#' | jq length`
if [ $response == "0" ]
then
  echo "PASSED"
else
  echo "ERROR"
  exit 1
fi

echo ""
echo "Can subscribe node 2 for urn:AirQuality:1 (destination tenant 2)?"
echo "==============================================================="
export response=`curl -s -o /dev/null -w "%{http_code}" --request POST 'http://localhost:8099/resource/urn:AirQuality:1/subscribe' --header 'fiware-Service: Tenant2' --header 'fiware-Servicepath: /'`
if [ $response == "200" ]
then
  echo "PASSED"
else
  echo "ERROR: Can't subscribe"
  exit 1
fi

echo ""
echo "Node 2 now has 3 policies for urn:AirQuality:1 in Tenant2"
echo "==============================================================="
export response=`curl -s -X 'GET' 'http://localhost:8086/v1/policies/?resource=urn%3AAirQuality%3A1&skip=0&limit=100' -H 'accept: application/json' -H 'fiware-service: Tenant2' -H 'fiware-servicepath: /#' | jq length`
if [ $response == "3" ]
then
  echo "PASSED"
else
  echo "ERROR"
  exit 1
fi
@github-actions github-actions bot added the todo label Oct 27, 2022
@chicco785 chicco785 added the enhancement New feature or request label Oct 27, 2022
@chicco785 chicco785 changed the title THIS IS REQUIRED UNTIL WE DON'T INJECT SUBSCRITION IN LUA remove uneeded subscription (when lua script ready) Oct 27, 2022
@chicco785 chicco785 added this to the 1.0 milestone Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request todo
Projects
None yet
Development

No branches or pull requests

1 participant