diff --git a/services/data-thesesul/tests.hurl b/services/data-thesesul/tests.hurl index 7ea35a22..345aa9f4 100644 --- a/services/data-thesesul/tests.hurl +++ b/services/data-thesesul/tests.hurl @@ -17,7 +17,7 @@ computing_token: jsonpath "$[0].value" [Asserts] variable "computing_token" exists -POST {{host}}/v1/retrieve-tests +POST {{host}}/v1/retrieve content-type: application/json [Options] delay: 10000 @@ -30,5 +30,7 @@ delay: 10000 ``` HTTP 200 -Content-Type: application/json -`[{"value":"True"}]` \ No newline at end of file +Content-type: application/x-gzip +[Asserts] +bytes count > 3890000 +bytes count < 3892000 \ No newline at end of file diff --git a/services/data-thesesul/v1/retrieve-tests.ini b/services/data-thesesul/v1/retrieve-tests.ini deleted file mode 100644 index 6a8330cd..00000000 --- a/services/data-thesesul/v1/retrieve-tests.ini +++ /dev/null @@ -1,14 +0,0 @@ -# This script is only usefull for tests -[use] -plugin = basics - -[JSONParse] -separator = * - -# Spécifique : un retrieve que pour les tests -[exec] -# command should be executable ! -command = ./v1/retrieve-tests.py - -[JSONString] -indent = false diff --git a/services/data-thesesul/v1/retrieve-tests.py b/services/data-thesesul/v1/retrieve-tests.py deleted file mode 100755 index b4fd7b19..00000000 --- a/services/data-thesesul/v1/retrieve-tests.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -import subprocess -import sys -import json - -retrieve_id = json.loads(sys.stdin.read())["value"] - -# Commande pour extraire l'archive -extract_cmd = f'cd /tmp/retrieve/ && tar -xzf {retrieve_id}' -subprocess.run(extract_cmd, shell=True) - -# Commande pour lister les fichiers -list_cmd = 'ls -p /tmp/retrieve/datas | grep -v /' -bash = subprocess.run(list_cmd, shell=True, capture_output=True) - -# Traiter le résultat -result = bash.stdout.decode("utf-8").strip().split("\n") - -# Supprimer les fichiers engendrés par l'extraction -list_cmd = 'rm -r /tmp/retrieve/datas && rm /tmp/retrieve/log.csv' -bash = subprocess.run(list_cmd, shell=True, capture_output=True) - -# On exécute le test -if set(result) == set(["271653795.zip","273522590.zip"]): - sys.stdout.write(json.dumps({"value":"True"})) -else: - sys.stdout.write(json.dumps({"value":"False"})) diff --git a/services/data-thesesul/v1/sudoc.py b/services/data-thesesul/v1/sudoc.py index 09046052..de4685fa 100755 --- a/services/data-thesesul/v1/sudoc.py +++ b/services/data-thesesul/v1/sudoc.py @@ -36,4 +36,3 @@ sys.stdout.write(json.dumps({"value":"empty, just to proc webhook"})) sys.stdout.write("\n") -