--- /dev/null
+events{}
+
+http {
+ include /etc/nginx/mime.types;
+
+ upstream backend {
+ server nonrtric-gateway:9090;
+ }
+
+ server {
+ listen 8080;
+ server_name localhost;
+ root /usr/share/nginx/html;
+ index index.html;
+ location /api/ {
+ proxy_pass http://backend;
+ }
+ }
+}
\ No newline at end of file
ports:
- 8080:8080
- 8082:8082
+ volumes:
+ - ./control-panel/config/nginx.conf:/etc/nginx/nginx.conf:ro
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl
ZOOKEEPER_SERVER_ID: 1
volumes:
- - ./zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
+ - ./mr/zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
networks:
- default
# Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
volumes:
- - ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
+ - ./mr/kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
networks:
- default
depends_on:
environment:
enableCadi: 'false'
volumes:
- - ./mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
- - ./mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
- - ./mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
+ - ./mr/mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+ - ./mr/mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
+ - ./mr/mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
networks:
- default
depends_on:
- 8081:8081
- 8433:8433
volumes:
- - ./config/application_configuration.json:/opt/app/policy-agent/data/application_configuration.json:ro
+ - ./policy-service/config/application_configuration.json:/opt/app/policy-agent/data/application_configuration.json:ro
# For using own certs instead of the default ones (built into the container),
# place them in config/ directory, update the application-policyagent.yaml file, and uncomment the following lines
- # - ./config/keystore-policyagent.jks:/opt/app/policy-agent/etc/cert/keystore.jks:ro
- # - ./config/truststore-policyagent.jks:/opt/app/policy-agent/etc/cert/truststore.jks:ro
- # - ./config/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro
+ # - ./policy-service/config/keystore-policyagent.jks:/opt/app/policy-agent/etc/cert/keystore.jks:ro
+ # - ./policy-service/config/truststore-policyagent.jks:/opt/app/policy-agent/etc/cert/truststore.jks:ro
+ # - ./policy-service/config/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro
aliases:
- r-app-catalogue
ports:
- - 8080:8080
- - 8433:8433
+ - 8680:8680
+ - 8633:8633
# For using own certs instead of the default ones (built into the container),
# place them in config/ directory, update the https-props-a1controller.properties file, and uncomment the following lines
#volumes:
- # - ./config/keystore-a1controller.jks:/etc/ssl/certs/java/keystore.jks:ro
- # - ./config/truststore-a1controller.jks:/etc/ssl/certs/java/truststore.jks:ro
- # - ./config/https-props-a1controller.properties:/opt/onap/sdnc/data/properties/https-props.properties:ro
+ # - ./sdnc/config/keystore-a1controller.jks:/etc/ssl/certs/java/keystore.jks:ro
+ # - ./sdnc/config/truststore-a1controller.jks:/etc/ssl/certs/java/truststore.jks:ro
+ # - ./sdnc/config/https-props-a1controller.properties:/opt/onap/sdnc/data/properties/https-props.properties:ro
logging:
driver: "json-file"
options:
WORKDIR /opt/app/r-app-catalogue
RUN mkdir -p /var/log/r-app-catalogue
+RUN mkdir -p /opt/app/r-app-catalogue/etc/cert/
-EXPOSE 8081 8433
+EXPOSE 8680 8633
ADD /config/application.yaml /opt/app/r-app-catalogue/config/application.yaml
+ADD /config/r-app-catalogue-keystore.jks /opt/app/r-app-catalogue/etc/cert/keystore.jks
ADD target/${JAR} /opt/app/r-app-catalogue/r-app-catalogue.jar
+ # ========================LICENSE_START=================================
+ # Copyright (C) 2021 Nordix Foundation. All rights reserved.
+ # ======================================================================
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ # ========================LICENSE_END===================================
+
spring:
profiles:
active: prod
-
+server:
+ # Configuration of the HTTP/REST server. The parameters are defined and handled by the springboot framework.
+ # See springboot documentation.
+ port : 8633
+ http-port: 8680
+ ssl:
+ key-store-type: JKS
+ key-store: /opt/app/r-app-catalogue/etc/cert/keystore.jks
+ key-store-password: r-app-catalogue
+ key-password: r-app-catalogue
+ key-alias: server-cert
<artifactId>junit-jupiter-engine</artifactId>\r
<scope>test</scope>\r
</dependency>\r
+ <dependency>\r
+ <groupId>org.springframework.boot</groupId>\r
+ <artifactId>spring-boot-starter-test</artifactId>\r
+ <scope>test</scope>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.apache.httpcomponents</groupId>\r
+ <artifactId>httpclient</artifactId>\r
+ <scope>test</scope>\r
+ </dependency>\r
+\r
</dependencies>\r
\r
<build>\r
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * Copyright (C) 2021 Nordix Foundation. All rights reserved.
+ * ======================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+package org.oransc.rappcatalogue.configuration;
+
+import org.apache.catalina.connector.Connector;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
+import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Configure embedded Tomcat
+ */
+
+@Configuration
+public class TomcatConfig {
+
+ @Value("${server.http-port}")
+ private int httpPort = 0;
+
+ // Embedded Tomcat with HTTP and HTTPS support
+ @Bean
+ public ServletWebServerFactory servletContainer() {
+ TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
+
+ if (httpPort > 0) {
+ tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));
+ }
+ return tomcat;
+ }
+
+ private static Connector getHttpConnector(int httpPort) {
+ Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
+ connector.setScheme("http");
+ connector.setPort(httpPort);
+ connector.setSecure(false);
+ return connector;
+ }
+}
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * Copyright (C) 2021 Nordix Foundation. All rights reserved.
+ * ======================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+package org.oransc.rappcatalogue;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
+import javax.net.ssl.SSLContext;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.client.ResourceAccessException;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@TestPropertySource(
+ properties = { //
+ "server.ssl.key-store=./config/r-app-catalogue-keystore.jks", //
+ "server.http-port=0"})
+public class HttpsRequestTest {
+
+ @Value("${server.ssl.key-store-password}")
+ private String keyStorePassword; // inject password from config
+
+ @Value("${server.ssl.key-store}")
+ private String keyStore; // inject keyStore from config
+
+ @LocalServerPort
+ private int port;
+
+ @Autowired
+ private AbstractConfigurableWebServerFactory webServerFactory;
+
+ @Test
+ public void testSsl() {
+ assertEquals(this.webServerFactory.getSsl().isEnabled(), true);
+ }
+
+ @Test
+ public void rest_OverPlainHttp_GetsBadRequestRequiresTLS() throws Exception {
+ TestRestTemplate template = new TestRestTemplate();
+ ResponseEntity<String> responseEntity =
+ template.getForEntity("http://localhost:" + port + "/services", String.class);
+ assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
+ assertTrue(responseEntity.getBody().contains("This combination of host and port requires TLS"));
+ }
+
+ @Test
+ public void rest_WithoutSSLConfiguration_ThrowsSSLExceptionUnableFindValidCertPath() throws Exception {
+ TestRestTemplate template = new TestRestTemplate();
+
+ ResourceAccessException thrown = assertThrows(ResourceAccessException.class, () -> {
+ template.getForEntity("https://localhost:" + port + "/services", String.class);
+ });
+ assertTrue(thrown.getMessage().contains("unable to find valid certification path to requested target"));
+ }
+
+ @Test
+ public void rest_WithTwoWaySSL_AuthenticatesAndGetsExpectedResponse() throws Exception {
+
+ SSLContext sslContext = new SSLContextBuilder().loadKeyMaterial(ResourceUtils.getFile(keyStore),
+ keyStorePassword.toCharArray(), keyStorePassword.toCharArray()).build();
+
+ SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext);
+ HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build();
+ HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
+ RestTemplateBuilder rtb =
+ new RestTemplateBuilder().requestFactory(() -> factory).rootUri("https://localhost:" + port);
+
+ TestRestTemplate template = new TestRestTemplate(rtb, null, null, HttpClientOption.SSL);
+
+ ResponseEntity<String> responseEntity = template.getForEntity("/services", String.class);
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ assertEquals("[]", responseEntity.getBody());
+ }
+
+}
ecs_api_a1_get_type 404 test-type
ecs_api_edp_get_type_ids 200 EMPTY
-ecs_api_edp_get_type 404 test-type
-
-ecs_api_edp_get_producer_ids 200 EMPTY
-ecs_api_edp_get_producer 404 test-prod
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_type 404 test-type
+else
+ ecs_api_edp_get_type_2 404 test-type
+fi
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 EMPTY
+ ecs_api_edp_get_producer 404 test-prod
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
+ ecs_api_edp_get_producer_2 404 test-prod
+fi
ecs_api_edp_get_producer_status 404 test-prod
ecs_api_edp_delete_producer 404 test-prod
ecs_api_edp_get_producer_jobs 404 test-prod
+if [ $ECS_VERSION == "V1-2" ]; then
+ ecs_api_edp_get_type_2 404 test-type
+ ecs_api_edp_delete_type_2 404 test-type
+fi
### Setup of producer/job and testing apis ###
## Setup prod-a
-ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
-ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+else
+ #V1-2
+ ecs_api_edp_get_type_ids 200 EMPTY
+ ecs_api_edp_get_type_2 404 type1
+ ecs_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+
+ # Create type, delete and create again
+ ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_type_2 200 type1
+ ecs_api_edp_get_type_ids 200 type1
+ ecs_api_edp_delete_type_2 204 type1
+ ecs_api_edp_get_type_2 404 type1
+ ecs_api_edp_get_type_ids 200 EMPTY
+ ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_type_ids 200 type1
+ ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
+
+ ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+ ecs_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+
+ ecs_api_edp_delete_type_2 406 type1
+fi
ecs_api_a1_get_type_ids 200 type1
fi
ecs_api_edp_get_type_ids 200 type1
-ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
+else
+ ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
+fi
-ecs_api_edp_get_producer_ids 200 prod-a
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a
+ ecs_api_edp_get_producer_ids_2 200 type1 prod-a
+ ecs_api_edp_get_producer_ids_2 200 type2 EMPTY
+fi
-ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+else
+ ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+fi
ecs_api_edp_get_producer_status 200 prod-a ENABLED
ecs_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ecs/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ecs/job-template.json
## Setup prod-b
-ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+else
+ ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
+ ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
+fi
+
ecs_api_a1_get_type_ids 200 type1 type2
if [ -z "$FLAT_A1_EI" ]; then
fi
ecs_api_edp_get_type_ids 200 type1 type2
-ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
-ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
-
-ecs_api_edp_get_producer_ids 200 prod-a prod-b
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_type 200 type1 testdata/ecs/ei-type-1.json prod-a
+ ecs_api_edp_get_type 200 type2 testdata/ecs/ei-type-2.json prod-b
+else
+ ecs_api_edp_get_type_2 200 type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_type_2 200 type2 testdata/ecs/ei-type-2.json
+fi
-ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
-ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
+fi
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+else
+ ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+ ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
+fi
ecs_api_edp_get_producer_status 200 prod-b ENABLED
## Setup prod-c (no types)
-ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
-
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
+else
+ ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
+fi
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
+fi
-ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
-ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
-ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+ ecs_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
+else
+ ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+ ecs_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
+ ecs_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
+fi
ecs_api_edp_get_producer_status 200 prod-c ENABLED
# Delete job then producer
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
+fi
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_delete_job 204 type2 job3
fi
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
+fi
ecs_api_edp_delete_producer 204 prod-b
ecs_api_edp_get_producer_status 404 prod-b
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
-ecs_api_edp_get_producer_ids 200 prod-a prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
+fi
prodstub_equal delete/prod-b/job3 1
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template.json
else
- ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
+ if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
+ else
+ ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template.json
+ ecs_api_a1_get_job_status 200 job3 DISABLED
+ fi
fi
# Put producer then job
-ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+else
+ ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
+fi
ecs_api_edp_get_producer_status 200 prod-b ENABLED
ecs_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
ecs_api_a1_get_job_status 200 type2 job3 ENABLED
else
- ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
+ if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
+ else
+ ecs_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ecs/job-template2.json
+ fi
ecs_api_a1_get_job_status 200 job3 ENABLED
fi
prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ecs/job-template2.json
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
+fi
-prodstub_equal create/prod-b/job3 2
+if [ $ECS_VERSION == "V1-1" ]; then
+ prodstub_equal create/prod-b/job3 2
+else
+ prodstub_equal create/prod-b/job3 3
+fi
prodstub_equal delete/prod-b/job3 1
# Delete only the producer
ecs_api_edp_get_producer_status 404 prod-b
ecs_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
-ecs_api_edp_get_producer_ids 200 prod-a prod-c
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-c
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
+fi
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type2 job3 DISABLED
cr_api_check_all_ecs_events 200 job3-status DISABLED
# Re-create the producer
-ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ecs/ei-type-2.json
+else
+ ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
+fi
ecs_api_edp_get_producer_status 200 prod-b ENABLED
## Setup prod-d
-ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
+else
+ ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-1.json
+ ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
+fi
ecs_api_a1_get_job_ids 200 type4 NOWNER EMPTY
fi
# Re-PUT the producer with zero types
-ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
+else
+ ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
+fi
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_ids 404 type4 NOWNER
prodstub_equal delete/prod-d/job8 0
## Re-setup prod-d
-ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json
+else
+ ecs_api_edp_put_type_2 200 type4 testdata/ecs/ei-type-4.json
+ ecs_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
+fi
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_ids 404 type4 NOWNER
## Setup prod-e
-ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ecs/ei-type-6.json
+else
+ ecs_api_edp_put_type_2 201 type6 testdata/ecs/ei-type-6.json
+ ecs_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
+fi
ecs_api_a1_get_job_ids 200 type6 NOWNER EMPTY
fi
## Setup prod-f
-ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ecs/ei-type-6.json
+else
+ ecs_api_edp_put_type_2 200 type6 testdata/ecs/ei-type-6.json
+ ecs_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
+fi
ecs_api_a1_get_job_ids 200 type6 NOWNER job10
## Status updates prod-a and jobs
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
+fi
ecs_api_edp_get_producer_status 200 prod-a ENABLED
ecs_api_edp_get_producer_status 200 prod-b ENABLED
# Wait for producer prod-a to go disabled
ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
+fi
ecs_api_edp_get_producer_status 200 prod-a DISABLED
ecs_api_edp_get_producer_status 200 prod-b ENABLED
# Wait for producer prod-a to go enabled
ecs_api_edp_get_producer_status 200 prod-a ENABLED 360
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
+fi
ecs_api_edp_get_producer_status 200 prod-a ENABLED
ecs_api_edp_get_producer_status 200 prod-b ENABLED
# Wait for producer prod-a to go disabled
ecs_api_edp_get_producer_status 200 prod-a DISABLED 360
-ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
+fi
ecs_api_edp_get_producer_status 200 prod-a DISABLED
ecs_api_edp_get_producer_status 200 prod-b ENABLED
# Wait for producer prod-a to be removed
ecs_equal json:ei-producer/v1/eiproducers 5 1000
-ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
+fi
+
ecs_api_edp_get_producer_status 404 prod-a
ecs_api_edp_get_producer_status 200 prod-b ENABLED
ecs_api_edp_get_producer_status 200 prod-e DISABLED 1000
-ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
+fi
ecs_api_edp_get_producer_status 404 prod-a
ecs_api_edp_get_producer_status 200 prod-b ENABLED
ecs_api_edp_get_producer_status 200 prod-e ENABLED 360
-ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
+fi
+
+#Wait for job to be updated
+sleep_wait 120
-#Job 10 should be updated when the producer goes enabled
-deviation "Job 10 should be updated when the producer prod-e goes enabled"
-prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ecs/job-template2.json
prodstub_arm_producer 200 prod-f 400
ecs_equal json:ei-producer/v1/eiproducers 4 1000
-ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
+else
+ ecs_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
+fi
ecs_api_edp_get_producer_status 404 prod-a
ecs_api_edp_get_producer_status 200 prod-b ENABLED
. ../common/prodstub_api_functions.sh
. ../common/control_panel_api_functions.sh
. ../common/controller_api_functions.sh
+. ../common/cr_api_functions.sh
#### TEST BEGIN ####
fi
done
-ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
-ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json
+ ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
-ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json
+ ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json
-ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json
+ ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json
+
+ ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json
+
+else
+
+ ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_put_type_2 201 type2 testdata/ecs/ei-type-2.json
+ ecs_api_edp_put_type_2 201 type3 testdata/ecs/ei-type-3.json
+ ecs_api_edp_put_type_2 201 type4 testdata/ecs/ei-type-4.json
+ ecs_api_edp_put_type_2 201 type5 testdata/ecs/ei-type-5.json
+
+ ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+
+ ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
+
+ ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
+
+ ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
+fi
ecs_equal json:ei-producer/v1/eiproducers 4
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type1 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 1 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type2 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 2 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type3 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 3 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type4 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 4 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type5 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
done
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type1 job$i DISABLED
else
- ecs_api_a1_get_job_status 200 job$i DISABLED
+ ecs_api_a1_get_job_status 200 job$i DISABLED 120
fi
fi
if [ $(($i%5)) -eq 1 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type2 job$i DISABLED
else
- ecs_api_a1_get_job_status 200 job$i DISABLED
+ ecs_api_a1_get_job_status 200 job$i DISABLED 120
fi
fi
if [ $(($i%5)) -eq 2 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type3 job$i DISABLED
else
- ecs_api_a1_get_job_status 200 job$i DISABLED
+ ecs_api_a1_get_job_status 200 job$i DISABLED 120
fi
fi
if [ $(($i%5)) -eq 3 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type4 job$i DISABLED
else
- ecs_api_a1_get_job_status 200 job$i DISABLED
+ ecs_api_a1_get_job_status 200 job$i DISABLED 120
fi
fi
if [ $(($i%5)) -eq 4 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type5 job$i DISABLED
else
- ecs_api_a1_get_job_status 200 job$i DISABLED
+ ecs_api_a1_get_job_status 200 job$i DISABLED 120
fi
fi
done
+if [ $ECS_VERSION == "V1-1" ]; then
+
+ ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+
+ ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json
+
+ ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json
-ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json
-ecs_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json
+else
+ ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+
+ ecs_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type1 type2
-ecs_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 testdata/ecs/ei-type-1.json type2 testdata/ecs/ei-type-2.json type3 testdata/ecs/ei-type-3.json
+ ecs_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c type1 type2 type3
-ecs_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ecs/ei-type-4.json type5 testdata/ecs/ei-type-5.json
+ ecs_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 type5
+
+fi
ecs_equal json:ei-producer/v1/eiproducers 4
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type1 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 1 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type2 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 2 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type3 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 3 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type4 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
if [ $(($i%5)) -eq 4 ]; then
if [ -z "$FLAT_A1_EI" ]; then
ecs_api_a1_get_job_status 200 type5 job$i ENABLED
else
- ecs_api_a1_get_job_status 200 job$i ENABLED
+ ecs_api_a1_get_job_status 200 job$i ENABLED 120
fi
fi
done
ecs_api_service_status 200
## Setup prod-a
-ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+if [ $ECS_VERSION == "V1-1" ]; then
+ ecs_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
-ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+ ecs_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ecs/ei-type-1.json
+else
+ ecs_api_edp_put_type_2 201 type1 testdata/ecs/ei-type-1.json
+
+ ecs_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+
+ ecs_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
+fi
ecs_api_edp_get_producer_status 200 prod-a ENABLED
if [ $# -eq 2 ] || [ $# -eq 3 ]; then
if [[ $1 == "json:"* ]]; then
if [ "$PMS_VERSION" == "V2" ]; then
- __var_test "Policy Agent" $PA_PATH"/v2/" $1 "=" $2 $3
+ __var_test "Policy Agent" $PA_PATH$PMS_API_PREFIX"/v2/" $1 "=" $2 $3
else
__var_test "Policy Agent" $PA_PATH"/" $1 "=" $2 $3
fi
# API Test function: GET ​/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status
# args: <response-code> <type-id> <job-id> [<status>]
-# args (flat uri structure): <response-code> <job-id> [<status>]
+# args (flat uri structure): <response-code> <job-id> [<status> [<timeout>]]
# (Function for test scripts)
ecs_api_a1_get_job_status() {
__log_test_start $@
fi
else
echo -e $YELLOW"USING NOT CONFIRMED INTERFACE - FLAT URI STRUCTURE"$EYELLOW
- if [ $# -ne 2 ] && [ $# -ne 3 ]; then
- __print_err "<response-code> <job-id> [<status>]" $@
+ if [ $# -lt 2 ] && [ $# -gt 4 ]; then
+ __print_err "<response-code> <job-id> [<status> [<timeout>]]" $@
return 1
fi
query="/A1-EI/v1/eijobs/$2/status"
- res="$(__do_curl_to_api ECS GET $query)"
- status=${res:${#res}-3}
+ start=$SECONDS
+ for (( ; ; )); do
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
- if [ $status -ne $1 ]; then
- __log_test_fail_status_code $1 $status
- return 1
- fi
- if [ $# -eq 3 ]; then
- body=${res:0:${#res}-3}
- targetJson="{\"eiJobStatus\": \"$3\"}"
- echo " TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+ if [ $# -eq 4 ]; then
+ duration=$((SECONDS-start))
+ echo -ne " Response=${status} after ${duration} seconds, waiting for ${3} ${SAMELINE}"
+ if [ $duration -gt $4 ]; then
+ echo ""
+ duration=-1 #Last iteration
+ fi
+ else
+ duration=-1 #single test, no wait
+ fi
- if [ $res -ne 0 ]; then
- __log_test_fail_body
- return 1
+ if [ $status -ne $1 ]; then
+ if [ $duration -eq -1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
fi
- fi
+ if [ $# -ge 3 ] && [ $status -eq $1 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="{\"eiJobStatus\": \"$3\"}"
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ if [ $duration -eq -1 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ else
+ duration=-1 #Goto pass
+ fi
+ fi
+ if [ $duration -eq -1 ]; then
+ if [ $# -eq 4 ]; then
+ echo ""
+ fi
+ __log_test_pass
+ return 0
+ else
+ sleep 1
+ fi
+ done
fi
__log_test_pass
# API Test function: GET /ei-producer/v1/eiproducers
-# args: <response-code> [ EMPTY | <producer-id>+]
+# args (v1_1): <response-code> [ EMPTY | <producer-id>+]
# (Function for test scripts)
ecs_api_edp_get_producer_ids() {
__log_test_start $@
return 0
}
+# API Test function: GET /ei-producer/v1/eiproducers
+# args (v1_2): <response-code> [ ( NOTYPE | <type-id> ) [ EMPTY | <producer-id>+] ]
+# (Function for test scripts)
+ecs_api_edp_get_producer_ids_2() {
+ __log_test_start $@
+
+ if [ $# -lt 1 ]; then
+ __print_err "<response-code> [ ( NOTYPE | <type-id> ) [ EMPTY | <producer-id>+] ]" $@
+ return 1
+ fi
+
+ query="/ei-producer/v1/eiproducers"
+ if [ $# -gt 1 ] && [ $2 != "NOTYPE" ]; then
+ query=$query"?ei_type_id=$2"
+ fi
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ if [ $# -gt 2 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="["
+
+ for pid in ${@:3} ; do
+ if [ "$targetJson" != "[" ]; then
+ targetJson=$targetJson","
+ fi
+ if [ $pid != "EMPTY" ]; then
+ targetJson=$targetJson"\"$pid\""
+ fi
+ done
+
+ targetJson=$targetJson"]"
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+
+ __log_test_pass
+ return 0
+}
+
# API Test function: GET /ei-producer/v1/eitypes/{eiTypeId}
-# args: <response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]
+# args: (v1_1) <response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]
# (Function for test scripts)
ecs_api_edp_get_type() {
__log_test_start $@
return 0
}
+# API Test function: GET /ei-producer/v1/eitypes/{eiTypeId}
+# args: (v1_2) <response-code> <type-id> [<job-schema-file> ]
+# (Function for test scripts)
+ecs_api_edp_get_type_2() {
+ __log_test_start $@
+
+ paramError=1
+ if [ $# -eq 2 ]; then
+ paramError=0
+ fi
+ if [ $# -eq 3 ]; then
+ paramError=0
+ fi
+ if [ $paramError -ne 0 ]; then
+ __print_err "<response-code> <type-id> [<job-schema-file> ]" $@
+ return 1
+ fi
+
+ query="/ei-producer/v1/eitypes/$2"
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+ if [ $# -eq 3 ]; then
+ body=${res:0:${#res}-3}
+
+ if [ -f $3 ]; then
+ schema=$(cat $3)
+ else
+ __log_test_fail_general "Job template file "$3", does not exist"
+ return 1
+ fi
+
+ targetJson="{\"ei_job_data_schema\":$schema}"
+
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+ __log_test_pass
+ return 0
+}
+
+# API Test function: PUT /ei-producer/v1/eitypes/{eiTypeId}
+# args: (v1_2) <response-code> <type-id> <job-schema-file>
+# (Function for test scripts)
+ecs_api_edp_put_type_2() {
+ __log_test_start $@
+
+ if [ $# -ne 3 ]; then
+ __print_err "<response-code> <type-id> <job-schema-file>" $@
+ return 1
+ fi
+
+ if [ ! -f $3 ]; then
+ __log_test_fail_general "Job schema file "$3", does not exist"
+ return 1
+ fi
+ schema=$(cat $3)
+ input_json="{\"ei_job_data_schema\":$schema}"
+ file="./tmp/put_type.json"
+ echo $input_json > $file
+
+ query="/ei-producer/v1/eitypes/$2"
+ res="$(__do_curl_to_api ECS PUT $query $file)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ __log_test_pass
+ return 0
+}
+
+# API Test function: DELETE /ei-producer/v1/eitypes/{eiTypeId}
+# args: (v1_2) <response-code> <type-id>
+# (Function for test scripts)
+ecs_api_edp_delete_type_2() {
+ __log_test_start $@
+
+ if [ $# -ne 2 ]; then
+ __print_err "<response-code> <type-id>" $@
+ return 1
+ fi
+
+ query="/ei-producer/v1/eitypes/$2"
+ res="$(__do_curl_to_api ECS DELETE $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ __log_test_pass
+ return 0
+}
+
# API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}
-# args: <response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]
+# args: (v1_1) <response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]
# (Function for test scripts)
ecs_api_edp_get_producer() {
__log_test_start $@
return 0
}
+# API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}
+# args (v1_2): <response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | <type-id>+) ]
+# (Function for test scripts)
+ecs_api_edp_get_producer_2() {
+ __log_test_start $@
+
+ #Possible arg count: 2, 5, 6, 7, 8 etc
+ paramError=1
+ if [ $# -eq 2 ]; then
+ paramError=0
+ fi
+ if [ $# -eq 5 ] && [ "$5" == "EMPTY" ]; then
+ paramError=0
+ fi
+ if [ $# -ge 5 ]; then
+ paramError=0
+ fi
+
+ if [ $paramError -ne 0 ]; then
+ __print_err "<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | <type-id>+) ]" $@
+ return 1
+ fi
+
+ query="/ei-producer/v1/eiproducers/$2"
+ res="$(__do_curl_to_api ECS GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ if [ $# -gt 2 ]; then
+ body=${res:0:${#res}-3}
+ targetJson="["
+ if [ $# -gt 4 ] && [ "$5" != "EMPTY" ]; then
+ arr=(${@:5})
+ for ((i=0; i<$(($#-4)); i=i+1)); do
+ if [ "$targetJson" != "[" ]; then
+ targetJson=$targetJson","
+ fi
+ targetJson=$targetJson"\"${arr[$i]}\""
+ done
+ fi
+ targetJson=$targetJson"]"
+ if [ $# -gt 4 ]; then
+ targetJson="{\"supported_ei_types\":$targetJson,\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\"}"
+ fi
+ echo " TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ __log_test_fail_body
+ return 1
+ fi
+ fi
+
+ __log_test_pass
+ return 0
+}
+
# API Test function: DELETE /ei-producer/v1/eiproducers/{eiProducerId}
# args: <response-code> <producer-id>
# (Function for test scripts)
}
# API Test function: PUT /ei-producer/v1/eiproducers/{eiProducerId}
-# args: <response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id> <schema-file>]+
+# args: (v1_1) <response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id> <schema-file>]+
# (Function for test scripts)
ecs_api_edp_put_producer() {
__log_test_start $@
return 0
}
+# API Test function: PUT /ei-producer/v1/eiproducers/{eiProducerId}
+# args: (v1_2) <response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id>+]
+# (Function for test scripts)
+ecs_api_edp_put_producer_2() {
+ __log_test_start $@
+
+ #Valid number of parametrer 5,6,8,10,
+ paramError=1
+ if [ $# -eq 5 ] && [ "$5" == "NOTYPE" ]; then
+ paramError=0
+ elif [ $# -ge 5 ]; then
+ paramError=0
+ fi
+ if [ $paramError -ne 0 ]; then
+ __print_err "<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id>+]" $@
+ return 1
+ fi
+
+ inputJson="["
+ if [ $# -gt 4 ] && [ "$5" != "NOTYPE" ]; then
+ arr=(${@:5})
+ for ((i=0; i<$(($#-4)); i=i+1)); do
+ if [ "$inputJson" != "[" ]; then
+ inputJson=$inputJson","
+ fi
+ inputJson=$inputJson"\""${arr[$i]}"\""
+ done
+ fi
+ inputJson="\"supported_ei_types\":"$inputJson"]"
+
+ inputJson=$inputJson",\"ei_job_callback_url\": \"$3\",\"ei_producer_supervision_callback_url\": \"$4\""
+
+ inputJson="{"$inputJson"}"
+
+ file="./tmp/.p.json"
+ echo "$inputJson" > $file
+ query="/ei-producer/v1/eiproducers/$2"
+ res="$(__do_curl_to_api ECS PUT $query $file)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ __log_test_fail_status_code $1 $status
+ return 1
+ fi
+
+ __log_test_pass
+ return 0
+}
+
# API Test function: GET /ei-producer/v1/eiproducers/{eiProducerId}/eijobs
# args: <response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)
# (Function for test scripts)
POLICY_AGENT_INTERNAL_SECURE_PORT=8433 # Policy Agent container internal secure port (container -> container)
POLICY_AGENT_APIS="V1 V2" # Supported northbound api versions
PMS_VERSION="V2" # Tested version of northbound API
-PMS_API_PREFIX="" # api url prefix, only for V2
+PMS_API_PREFIX="/a1-policy" # api url prefix, only for V2. Shall contain leading "/"
POLICY_AGENT_APP_NAME="policymanagementservice" # Name for Policy Agent container
POLICY_AGENT_DISPLAY_NAME="Policy Management Service"
POLICY_AGENT_CONFIG_KEY="policy-agent" # Key for consul config
POLICY_AGENT_PKG_NAME="org.onap.ccsdk.oran.a1policymanagementservice" # Java base package name
POLICY_AGENT_ACTUATOR="/actuator/loggers/$POLICY_AGENT_PKG_NAME" # Url for trace/debug
-POLICY_AGENT_ALIVE_URL="/v2/status" # Base path for alive check
+POLICY_AGENT_ALIVE_URL="$PMS_API_PREFIX/v2/status" # Base path for alive check
POLICY_AGENT_COMPOSE_DIR="policy_agent" # Dir in simulator_group for docker-compose
POLICY_AGENT_CONFIG_MOUNT_PATH="/opt/app/policy-agent/config" # Path in container for config file
POLICY_AGENT_DATA_MOUNT_PATH="/opt/app/policy-agent/data" # Path in container for data file
ECS_COMPOSE_DIR="ecs" # Dir in simulator_group for docker-compose
ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
ECS_CONFIG_FILE=application.yaml # Config file name
+ECS_VERSION="V1-1" # Version where the types are added in the producer registration
MR_DMAAP_APP_NAME="dmaap-mr" # Name for the Dmaap MR
MR_STUB_APP_NAME="mr-stub" # Name of the MR stub
ECS_COMPOSE_DIR="ecs" # Dir in simulator_group for docker-compose
ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
ECS_CONFIG_FILE=application.yaml # Config file name
-
+ECS_VERSION="V1-1" # Version where the types are added in the producer registration
MR_DMAAP_APP_NAME="dmaap-mr" # Name for the Dmaap MR
MR_STUB_APP_NAME="mr-stub" # Name of the MR stub
ECS_COMPOSE_DIR="ecs" # Dir in simulator_group for docker-compose
ECS_CONFIG_MOUNT_PATH=/opt/app/enrichment-coordinator-service/config # Internal container path for configuration
ECS_CONFIG_FILE=application.yaml # Config file name
-
+ECS_VERSION="V1-2" # Version where the types are decoupled from the producer registration
MR_DMAAP_APP_NAME="dmaap-mr" # Name for the Dmaap MR
MR_STUB_APP_NAME="mr-stub" # Name of the MR stub
var rc_services=""
+var pmsprefix=""
+
function fetchAllMetrics_pol() {
console.log("Fetching policy metrics " + refreshCount_pol)
refreshCount_rc=5
var bn=req.query.basename
+ pmsprefix=req.query.pmsprefix
- if (bn == undefined) {
+ console.log("PMS"+pmsprefix)
+ if ((bn == undefined) || (pmsprefix == undefined)) {
getCtr=0
- return res.redirect('/mon?basename=ricsim');
+ return res.redirect('/mon?basename=ricsim&pmsprefix=/a1-policy/v2');
} else {
ricbasename=bn
}
+
//Build web page
var htmlStr = "<!DOCTYPE html>" +
"<html>" +
"<body>" +
"<font size=\"-3\" face=\"monospace\">" +
"<p>Change basename in url if other ric sim prefix is used</p>" +
+ "<p>Change pmsprefix in url if pms with other prefix is used</p>" +
"</font>" +
"<h3>Policy agent</h3>" +
"<font face=\"monospace\">" +