From 373231dcf7fc9713d4a2137eaac7904a60b42909 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Wed, 7 Feb 2024 11:27:13 -0600 Subject: [PATCH] Use float seconds for LATENCY_TO_PE --- share/schemas/serverless_runtime.json | 5 +++-- tests/lib/common.rb | 2 ++ tests/lib/crud.rb | 2 +- tests/templates/sr_faas_device_info.json | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/schemas/serverless_runtime.json b/share/schemas/serverless_runtime.json index 0db6abd..b9360a1 100644 --- a/share/schemas/serverless_runtime.json +++ b/share/schemas/serverless_runtime.json @@ -110,8 +110,9 @@ "description": "Information about the engine Client Device environment", "properties": { "LATENCY_TO_PE": { - "type": "integer", - "description": "Latency from the client device to the Provisioning Engine endpoint in miliseconds" + "type": "number", + "format": "float", + "description": "Latency from the client device to the Provisioning Engine endpoint in seconds" }, "GEOGRAPHIC_LOCATION": { "type": "string", diff --git a/tests/lib/common.rb b/tests/lib/common.rb index fc3502c..520ee75 100644 --- a/tests/lib/common.rb +++ b/tests/lib/common.rb @@ -222,6 +222,8 @@ def randomize_schevice?(specification) specification[SRR][schevice].each do |k, v| if v.is_a?(Integer) specification[SRR][schevice][k] = rand(2147483647) + elsif v.is_a?(Float) + specification[SRR][schevice][k] = rand else specification[SRR][schevice][k] = SecureRandom.alphanumeric end diff --git a/tests/lib/crud.rb b/tests/lib/crud.rb index 76e8ec7..29ae741 100644 --- a/tests/lib/crud.rb +++ b/tests/lib/crud.rb @@ -65,7 +65,7 @@ else verify_error(runtime) - raise "Unexpected error code #{rc}" + raise "Unexpected error code #{rc}\n#{runtime}" end end end diff --git a/tests/templates/sr_faas_device_info.json b/tests/templates/sr_faas_device_info.json index 0a42fd0..c7f89f1 100644 --- a/tests/templates/sr_faas_device_info.json +++ b/tests/templates/sr_faas_device_info.json @@ -4,7 +4,7 @@ "FLAVOUR": "Function" }, "DEVICE_INFO": { - "LATENCY_TO_PE": 100, + "LATENCY_TO_PE": 0.360587, "GEOGRAPHIC_LOCATION": "Madrid" } }