This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' for 0.1.0
- Loading branch information
Showing
11 changed files
with
183 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,5 @@ services: | |
exp-nsd-composer: | ||
build: | ||
context: . | ||
container_name: exp-nsd-composer | ||
ports: | ||
- 8086:8086 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
src/main/java/it/cnit/blueprint/composer/nsd/rest/ComposeResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/test/java/it/cnit/blueprint/composer/rules/TranslationRulesComposerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package it.cnit.blueprint.composer.rules; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
import it.nextworks.nfvmano.catalogue.blueprint.elements.VsdNsdTranslationRule; | ||
import it.nextworks.nfvmano.libs.ifa.descriptors.nsd.Nsd; | ||
import java.io.InputStream; | ||
import java.net.URL; | ||
import java.util.List; | ||
import java.util.Properties; | ||
import lombok.SneakyThrows; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
@Slf4j | ||
public class TranslationRulesComposerTest { | ||
|
||
static Properties urlProp; | ||
static ObjectMapper oM; | ||
static TranslationRulesComposer translationRulesComposer; | ||
|
||
@BeforeClass | ||
@SneakyThrows | ||
public static void setUp() { | ||
// Test Setup | ||
urlProp = new Properties(); | ||
InputStream input = ClassLoader.getSystemResourceAsStream("url.properties"); | ||
urlProp.load(input); | ||
oM = new ObjectMapper(new YAMLFactory()); | ||
translationRulesComposer = new TranslationRulesComposer(); | ||
} | ||
|
||
@Test | ||
@SneakyThrows | ||
public void compose() { | ||
// Given | ||
InputStream in = getClass() | ||
.getResourceAsStream("/expb_ares2t_tracker_delay_nsds_passthrough.yaml"); | ||
Nsd expNsd = oM.readValue(in, Nsd[].class)[0]; | ||
List<VsdNsdTranslationRule> vsbTr = oM | ||
.readValue(new URL(urlProp.getProperty("vsb_ares2t_tracker_tr")), | ||
new TypeReference<List<VsdNsdTranslationRule>>() { | ||
}); | ||
log.info("old rules\n{}", oM.writeValueAsString(vsbTr)); | ||
|
||
// When | ||
List<VsdNsdTranslationRule> newRules = translationRulesComposer.compose(expNsd, vsbTr); | ||
log.info("new rules\n{}", oM.writeValueAsString(newRules)); | ||
|
||
// Then | ||
in = getClass() | ||
.getResourceAsStream("/expb_ares2t_tracker_delay_tr.yaml"); | ||
List<VsdNsdTranslationRule> expectedRules = oM | ||
.readValue(in, new TypeReference<List<VsdNsdTranslationRule>>() { | ||
}); | ||
assertEquals(oM.writeValueAsString(expectedRules), oM.writeValueAsString(newRules)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: '1.5' | ||
name: TCB Ares2T Service | ||
description: Test case to run the Ares2T | ||
configurationScript: 'EXECUTE_COMMAND vnf.396d1b6b-331b-4dd7-b48e-376517d3654a.extcp.cp_dg_mgmt.ipaddress | ||
$$user:$$password sudo /home/ubuntu/scripts/nginx_configuration.sh vnf.419b1884-aea1-4cad-8647-c2cec55287b9.extcp.cp_tracker_ext_in.ipaddress; | ||
EXECUTE_COMMAND vnf.396d1b6b-331b-4dd7-b48e-376517d3654a.extcp.cp_dg_mgmt.ipaddress | ||
$$user:$$password sudo tc qdisc add dev ens5 root netem delay $$DELAYms 20ms 25%; | ||
EXECUTE_COMMAND vnf.419b1884-aea1-4cad-8647-c2cec55287b9.extcp.cp_tracker_mgmt.ipaddress | ||
$$user:$$password sudo /home/ubuntu/scripts/filebeat_configuration.sh vnf.51c420e3-c83d-4ce9-a5bf-0dbe339b351d.extcp.cp_vis_data.ipaddress; | ||
EXECUTE_COMMAND vnf.51c420e3-c83d-4ce9-a5bf-0dbe339b351d.extcp.cp_vis_mgmt.ipaddress | ||
$$user:$$password sudo /home/ubuntu/scripts/metricbeat_configuration.sh 10.50.7.25:9092 | ||
$$metric.topic.tracking_response_time $$metric.topic.tracking_memory_usage; EXECUTE_COMMAND | ||
vnf.ef28e213-2f89-4b55-9e33-089df1ffd528.extcp.cp_recognition_mgmt.ipaddress $$user:$$password | ||
sudo /home/ubuntu/scripts/filebeat_configuration.sh 10.50.7.25:9092 $$metric.topic.recognition_network_time | ||
$$metric.topic.recognition_accuracy; EXECUTE_COMMAND vnf.ef28e213-2f89-4b55-9e33-089df1ffd528.extcp.cp_recognition_mgmt.ipaddress | ||
$$user:$$password sudo /home/ubuntu/scripts/metricbeat_configuration.sh 10.50.7.25:9092 | ||
$$metric.topic.recognition_response_time $$metric.topic.recognition_memory_usage ' | ||
executionScript: SLEEP $$sleep$$time | ||
userParameters: | ||
sleeping_time: $$sleep$$time | ||
delay: $$DELAY | ||
username: $$user | ||
password: $$password | ||
infrastructureParameters: | ||
vnf.51c420e3-c83d-4ce9-a5bf-0dbe339b351d.extcp.cp_vis_data.ipaddress: '' | ||
vnf.51c420e3-c83d-4ce9-a5bf-0dbe339b351d.extcp.cp_vis_mgmt.ipaddress: '' | ||
vnf.419b1884-aea1-4cad-8647-c2cec55287b9.extcp.cp_tracker_mgmt.ipaddress: '' | ||
vnf.419b1884-aea1-4cad-8647-c2cec55287b9.extcp.cp_tracker_ext_in.ipaddress: '' | ||
vnf.396d1b6b-331b-4dd7-b48e-376517d3654a.extcp.cp_dg_mgmt.ipaddress: '' | ||
$$metric.topic.tracking_memory_usage: '' | ||
$$metric.topic.tracking_response_time: '' | ||
$$metric.topic.recognition_network_time: '' | ||
$$metric.topic.recognition_accuracy: '' | ||
$$metric.topic.recognition_response_time: '' | ||
$$metric.topic.recognition_memory_usage: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- input: | ||
- parameterId: "number_of_tracked_devices" | ||
minValue: 1 | ||
maxValue: 100 | ||
nstId: null | ||
nsdId: "58886b95-cd29-4b7b-aca0-e884caaa5c68" | ||
nsdVersion: "1.0" | ||
nsFlavourId: "ns_Ares2T_Tracking_df" | ||
nsInstantiationLevelId: "ns_ares2t_tracker_il_small" | ||
# default: false | ||
- input: | ||
- parameterId: "number_of_tracked_devices" | ||
minValue: 101 | ||
maxValue: 1000 | ||
nstId: null | ||
nsdId: "58886b95-cd29-4b7b-aca0-e884caaa5c68" | ||
nsdVersion: "1.0" | ||
nsFlavourId: "ns_Ares2T_Tracking_df" | ||
nsInstantiationLevelId: "ns_ares2t_tracker_il_big" | ||
# default: false |
Oops, something went wrong.