summaryrefslogtreecommitdiffstats
path: root/sli
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dt5972@att.com>2018-03-24 19:11:10 -0400
committerTimoney, Dan (dt5972) <dt5972@att.com>2018-03-27 14:58:43 -0400
commita0ab49e6c1ea41af18656d6e9efb3377051f2528 (patch)
treedc935417ffa4aac764aef2f1978c1ceecd68bd55 /sli
parent5e0f12e215d579b2adff145a8527cc6a225d8db9 (diff)
Add unit tests for sli
Added unit tests for ccsdk/sli/core/sli Change-Id: I0d2408c43b9e56a78f3e01e87985aedb6cad5953 Issue-ID: CCSDK-213 Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Diffstat (limited to 'sli')
-rwxr-xr-xsli/common/pom.xml12
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java6
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java13
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java1
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java6
-rw-r--r--sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java139
-rw-r--r--sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/PrintYangToPropTest.java22
-rw-r--r--sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestMetricLogger.java135
-rw-r--r--sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java38
-rwxr-xr-xsli/common/src/test/resources/dblib.properties14
-rw-r--r--sli/common/src/test/resources/graphs/sliapi/graph.versions1
-rw-r--r--sli/common/src/test/resources/graphs/sliapi/sli_healthcheck.xml27
-rw-r--r--sli/common/src/test/resources/l3sdn_logic_v10.xml208
-rwxr-xr-xsli/common/src/test/resources/parser-good.tests1
-rw-r--r--sli/common/src/test/resources/svclogic.properties7
-rwxr-xr-xsli/common/src/test/resources/svclogic.xsd11
-rwxr-xr-xsli/provider/pom.xml96
-rw-r--r--sli/provider/src/main/resources/svclogic.properties25
-rw-r--r--sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java29
-rwxr-xr-xsli/provider/src/test/resources/executor.tests4
-rw-r--r--sli/provider/src/test/resources/l3sdn_logic_v10.xml23
-rw-r--r--sli/provider/src/test/resources/svclogic.properties4
22 files changed, 695 insertions, 127 deletions
diff --git a/sli/common/pom.xml b/sli/common/pom.xml
index 1d35dfb1..c22c1ae6 100755
--- a/sli/common/pom.xml
+++ b/sli/common/pom.xml
@@ -18,6 +18,12 @@
<name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
<description>The SLI Common package includes common classes used by the various SLI subcomponents, as well as classes used by clients to interface with the service logic interpreter</description>
+ <properties>
+ <!-- Ignore deprecated classes in coverage counts -->
+ <sonar.coverage.exclusions>**/MessageWriter.java</sonar.coverage.exclusions>
+
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -31,9 +37,9 @@
</dependencyManagement>
<dependencies>
<dependency>
- <groupId>ch.vorburger.mariaDB4j</groupId>
- <artifactId>mariaDB4j</artifactId>
- <version>2.2.3</version>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.11.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java
index c75873eb..0e39896e 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java
@@ -8,9 +8,9 @@
* 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.
@@ -38,7 +38,7 @@ import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
+@Deprecated
public class MessageWriter {
private static final Logger LOG = LoggerFactory.getLogger(MessageWriter.class);
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
index ee3bcca5..864652b4 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
@@ -66,6 +66,19 @@ public class SvcLogicDblibStore implements SvcLogicStore {
this.dbSvc = dbsvc;
}
+ public SvcLogicDblibStore(Properties props) {
+ try {
+ dbSvc = new DBResourceManager(props);
+ JavaSingleton.setInstance(dbSvc);
+ } catch (Exception e) {
+ LOG.warn("Caught exception trying to create DBResourceManager", e);
+ }
+ }
+
+ public Connection getConnection() throws SQLException {
+ return(dbSvc.getConnection());
+ }
+
@Override
public void init(Properties props) throws ConfigurationException {
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java
index e2fbdf72..0e7d05a6 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java
@@ -38,7 +38,6 @@ import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
public class SvcLogicJdbcStore implements SvcLogicStore {
private static final Logger LOG = LoggerFactory.getLogger(SvcLogicJdbcStore.class);
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
index 3d9caffb..2804f620 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java
@@ -437,7 +437,7 @@ public class SvcLogicParser {
}
-
+
public static void load(String xmlfile, SvcLogicStore store) throws SvcLogicException {
File xmlFile = new File(xmlfile);
if (!xmlFile.canRead()) {
@@ -531,7 +531,7 @@ public class SvcLogicParser {
}
- private static void activate(String module, String rpc, String version, String mode, SvcLogicStore store) {
+ public static void activate(String module, String rpc, String version, String mode, SvcLogicStore store) {
String details = "(module:" + module + ", rpc:" + rpc + ", version:" + version + ", mode:" + mode + ")";
try {
@@ -560,7 +560,7 @@ public class SvcLogicParser {
System.exit(1);
}
-
+
protected SAXParser initParser() throws ParserConfigurationException, SAXException {
URL xsdUrl = null;
Schema schema = null;
diff --git a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java
index 368d9f95..6ee18e92 100644
--- a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java
+++ b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java
@@ -32,11 +32,13 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Properties;
-import ch.vorburger.mariadb4j.DB;
-import ch.vorburger.mariadb4j.DBConfigurationBuilder;
-
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -67,17 +69,9 @@ public class ITCaseSvcLogicParser {
props.load(propStr);
+ store = SvcLogicStoreFactory.getSvcLogicStore(props);
- // Start MariaDB4j database
- DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder();
- config.setPort(0); // 0 => autom. detect free port
- DB db = DB.newEmbeddedDB(config.build());
- db.start();
-
-
- // Override jdbc URL and database name
- props.setProperty("org.onap.ccsdk.sli.jdbc.database", "test");
- props.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test"));
+ assertNotNull(store);
}
@@ -120,8 +114,123 @@ public class ITCaseSvcLogicParser {
}
try {
- SvcLogicParser.validate(testCaseUrl.getPath(), store);
+ SvcLogicParser.load(testCaseUrl.getPath(), store);
} catch (Exception e) {
+
+ fail("Validation failure [" + e.getMessage() + "]");
+ }
+ }
+ }
+ } catch (SvcLogicParserException e) {
+ fail("Parser error : " + e.getMessage());
+ } catch (Exception e) {
+ LOG.error("", e);
+ fail("Caught exception processing test cases");
+ }
+ }
+
+ @Test
+ public void testDblibLoadValidXml() throws IOException, SQLException, ConfigurationException {
+
+ URL propUrl = ITCaseSvcLogicParser.class.getResource("/dblib.properties");
+
+ InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/dblib.properties");
+
+ Properties props = new Properties();
+
+ props.load(propStr);
+
+ SvcLogicDblibStore dblibStore = new SvcLogicDblibStore(props);
+
+ Connection dbConn = dblibStore.getConnection();
+
+ String dbName = props.getProperty("org.onap.ccsdk.sli.jdbc.database", "sdnctl");
+
+ DatabaseMetaData dbm;
+
+ try {
+ dbm = dbConn.getMetaData();
+ } catch (SQLException e) {
+
+ throw new ConfigurationException("could not get databse metadata", e);
+ }
+
+ // See if table SVC_LOGIC exists. If not, create it.
+ Statement stmt = null;
+ try {
+
+ ResultSet tables = dbm.getTables(null, null, "SVC_LOGIC", null);
+ if (tables.next()) {
+ LOG.debug("SVC_LOGIC table already exists");
+ } else {
+ String crTableCmd = "CREATE TABLE " + dbName + ".SVC_LOGIC (" + "module varchar(80) NOT NULL,"
+ + "rpc varchar(80) NOT NULL," + "version varchar(40) NOT NULL," + "mode varchar(5) NOT NULL,"
+ + "active varchar(1) NOT NULL," + "graph BLOB,"
+ + "CONSTRAINT P_SVC_LOGIC PRIMARY KEY(module, rpc, version, mode))";
+
+ stmt = dbConn.createStatement();
+ stmt.executeUpdate(crTableCmd);
+ }
+ } catch (Exception e) {
+ throw new ConfigurationException("could not create SVC_LOGIC table", e);
+ } finally {
+ if (stmt != null) {
+ try {
+ stmt.close();
+ } catch (SQLException e) {
+ LOG.error("Statement close error ", e);
+ }
+ }
+ }
+
+ // See if NODE_TYPES table exists and, if not, create it
+ stmt = null;
+ try {
+
+ ResultSet tables = dbm.getTables(null, null, "NODE_TYPES", null);
+ if (tables.next()) {
+ LOG.debug("NODE_TYPES table already exists");
+ } else {
+ String crTableCmd = "CREATE TABLE " + dbName + ".NODE_TYPES (" + "nodetype varchar(80) NOT NULL,"
+ + "CONSTRAINT P_NODE_TYPES PRIMARY KEY(nodetype))";
+
+ stmt = dbConn.createStatement();
+
+ stmt.executeUpdate(crTableCmd);
+ }
+ } catch (Exception e) {
+ throw new ConfigurationException("could not create SVC_LOGIC table", e);
+ } finally {
+ if (stmt != null) {
+ try {
+ stmt.close();
+ } catch (SQLException e) {
+ LOG.error("Statement close error ", e);
+ }
+ }
+ }
+
+ try {
+ InputStream testStr = getClass().getResourceAsStream("/parser-good.tests");
+ BufferedReader testsReader = new BufferedReader(new InputStreamReader(testStr));
+ String testCaseFile = null;
+ while ((testCaseFile = testsReader.readLine()) != null) {
+
+ testCaseFile = testCaseFile.trim();
+
+ if (testCaseFile.length() > 0) {
+ if (!testCaseFile.startsWith("/")) {
+ testCaseFile = "/" + testCaseFile;
+ }
+ URL testCaseUrl = getClass().getResource(testCaseFile);
+ if (testCaseUrl == null) {
+ fail("Could not resolve test case file " + testCaseFile);
+ }
+
+ try {
+ SvcLogicParser.load(testCaseUrl.getPath(), dblibStore);
+ } catch (Exception e) {
+
fail("Validation failure [" + e.getMessage() + "]");
}
}
@@ -152,7 +261,7 @@ public class ITCaseSvcLogicParser {
if (testCaseUrl == null) {
fail("Could not resolve test case file " + testCaseFile);
}
- SvcLogicParser.load(testCaseUrl.getPath(), store);
+ SvcLogicParser.validate(testCaseUrl.getPath(), store);
}
}
}
diff --git a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/PrintYangToPropTest.java b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/PrintYangToPropTest.java
index 21d3e59c..fb6eaf70 100644
--- a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/PrintYangToPropTest.java
+++ b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/PrintYangToPropTest.java
@@ -15,6 +15,9 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.Exe
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefixBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,6 +53,22 @@ public class PrintYangToPropTest {
pBuilder.setIntValue(null);
pBuilder.setBooleanValue(true);
pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipaddress-value1");
+ pBuilder.setBooleanValue(null);
+ pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("127.0.0.1"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipaddress-value1");
+ pBuilder.setIpaddressValue(IpAddressBuilder.getDefaultInstance("::1"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipprefix-value1");
+ pBuilder.setIpaddressValue(null);
+ pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("192.168.0.0/16"));
+ pList.add(pBuilder.build());
+ pBuilder.setParameterName("ipprefix-value2");
+ pBuilder.setIpprefixValue(IpPrefixBuilder.getDefaultInstance("2001:db8:3c4d::/48"));
+ pList.add(pBuilder.build());
+
+
egBuilder.setSliParameter(pList);
@@ -64,6 +83,9 @@ public class PrintYangToPropTest {
LOG.info("Property {} = {}", propName, props.getProperty(propName));
}
+ // Generate builder from properties just generated
+ PrintYangToProp.toBuilder(props, pBuilder);
+
}
}
diff --git a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestMetricLogger.java b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestMetricLogger.java
new file mode 100644
index 00000000..31a419bb
--- /dev/null
+++ b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestMetricLogger.java
@@ -0,0 +1,135 @@
+package org.onap.ccsdk.sli.core.sli;
+
+import static org.junit.Assert.*;
+import java.util.Date;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestMetricLogger {
+
+ MetricLogger logger;
+
+ @Before
+ public void setUp() throws Exception {
+
+ logger = new MetricLogger();
+ logger.resetContext();
+ logger.logRequest("svcInstance1", "svcName", "svcPartner", "targetEntity", "targetServiceName", "targetVirtualEntity", "hello-world");
+ logger.logResponse("200", "200", "SUCCESS");
+
+ }
+
+ @Test
+ public final void testGetBeginTimestamp() {
+ logger.getBeginTimestamp();
+ }
+
+ @Test
+ public final void testGetEndTimestamp() {
+ logger.getEndTimestamp();
+ }
+
+ @Test
+ public final void testGetRequestID() {
+ logger.getRequestID();
+ }
+
+ @Test
+ public final void testGetServiceInstanceID() {
+ logger.getServiceInstanceID();
+ }
+
+ @Test
+ public final void testGetServiceName() {
+ logger.getServiceName();
+ }
+
+ @Test
+ public final void testGetPartnerName() {
+ logger.getPartnerName();
+ }
+
+ @Test
+ public final void testGetTargetEntity() {
+ logger.getTargetEntity();
+ }
+
+ @Test
+ public final void testGetTargetServiceName() {
+ logger.getTargetServiceName();
+ }
+
+ @Test
+ public final void testGetStatusCode() {
+ logger.getStatusCode();
+ }
+
+ @Test
+ public final void testGetResponseCode() {
+ logger.getResponseCode();
+ }
+
+ @Test
+ public final void testGetResponseDescription() {
+ logger.getResponseDescription();
+ }
+
+ @Test
+ public final void testGetInstanceUUID() {
+ logger.getInstanceUUID();
+ }
+
+ @Test
+ public final void testGetCategoryLogLevel() {
+ logger.getCategoryLogLevel();
+ }
+
+ @Test
+ public final void testGetSeverity() {
+ logger.getSeverity();
+ }
+
+ @Test
+ public final void testGetServerIpAddress() {
+ logger.getServerIpAddress();
+ }
+
+ @Test
+ public final void testGetElapsedTime() {
+ logger.getElapsedTime();
+ }
+
+ @Test
+ public final void testGetServer() {
+ logger.getServer();
+ }
+
+ @Test
+ public final void testGetClientIp() {
+ logger.getClientIp();
+ }
+
+ @Test
+ public final void testGetClassName() {
+ logger.getClassName();
+ }
+
+ @Test
+ public final void testGetTargetVirtualEntity() {
+ logger.getTargetVirtualEntity();
+ }
+
+ @Test
+ public final void testAsIso8601Date() {
+ logger.asIso8601(new Date());
+ }
+
+ @Test
+ public final void testAsIso8601Long() {
+ logger.asIso8601(System.currentTimeMillis());
+ }
+
+
+
+
+}
diff --git a/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java
new file mode 100644
index 00000000..8998382e
--- /dev/null
+++ b/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java
@@ -0,0 +1,38 @@
+package org.onap.ccsdk.sli.core.sli;
+
+import static org.junit.Assert.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+import org.junit.Test;
+
+public class TestSvcLogicLoader {
+
+ @Test
+ public void testLoadAndActivate() throws IOException, SvcLogicException {
+ URL propUrl = ITCaseSvcLogicParser.class.getResource("/svclogic.properties");
+
+ InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");
+
+ Properties props = new Properties();
+
+ props.load(propStr);
+
+ SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(props);
+
+ URL graphUrl = TestSvcLogicLoader.class.getClassLoader().getResource("graphs");
+
+ if (graphUrl == null) {
+ fail("Cannot find graphs directory");
+ }
+
+ SvcLogicLoader loader = new SvcLogicLoader(graphUrl.getPath(), store);
+ loader.loadAndActivate();
+
+
+ }
+
+
+
+}
diff --git a/sli/common/src/test/resources/dblib.properties b/sli/common/src/test/resources/dblib.properties
new file mode 100755
index 00000000..f08dce7a
--- /dev/null
+++ b/sli/common/src/test/resources/dblib.properties
@@ -0,0 +1,14 @@
+org.onap.ccsdk.sli.dbtype=jdbc
+org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01,sdnctldb02
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:test;create=true
+org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+org.onap.ccsdk.sli.jdbc.database=test
+org.onap.ccsdk.sli.jdbc.user=test
+org.onap.ccsdk.sli.jdbc.password=test
+org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
+
+org.onap.ccsdk.sli.jdbc.connection.timeout=50
+org.onap.ccsdk.sli.jdbc.request.timeout=100
+org.onap.ccsdk.sli.jdbc.limit.init=10
+org.onap.ccsdk.sli.jdbc.limit.min=10
+org.onap.ccsdk.sli.jdbc.limit.max=20
diff --git a/sli/common/src/test/resources/graphs/sliapi/graph.versions b/sli/common/src/test/resources/graphs/sliapi/graph.versions
new file mode 100644
index 00000000..d72920a4
--- /dev/null
+++ b/sli/common/src/test/resources/graphs/sliapi/graph.versions
@@ -0,0 +1 @@
+sli healthcheck 1.0.0 sync
diff --git a/sli/common/src/test/resources/graphs/sliapi/sli_healthcheck.xml b/sli/common/src/test/resources/graphs/sliapi/sli_healthcheck.xml
new file mode 100644
index 00000000..d512f546
--- /dev/null
+++ b/sli/common/src/test/resources/graphs/sliapi/sli_healthcheck.xml
@@ -0,0 +1,27 @@
+<!--
+ ============LICENSE_START=======================================================
+ openECOMP : SDN-C
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. 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=========================================================
+ -->
+
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='sli' version='1.0.0'><method rpc='healthcheck' mode='sync'>
+<set>
+<parameter name='error-code' value='200' />
+<parameter name='error-message' value='SDN-C is healthy'/>
+<parameter name='ack-final' value='Y'/>
+</set></method></service-logic>
diff --git a/sli/common/src/test/resources/l3sdn_logic_v10.xml b/sli/common/src/test/resources/l3sdn_logic_v10.xml
new file mode 100644
index 00000000..58a420f9
--- /dev/null
+++ b/sli/common/src/test/resources/l3sdn_logic_v10.xml
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ============LICENSE_START=======================================================
+ ONAP : CCSDK ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. 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========================================================= -->
+
+
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd"
+ module="neutron" version="1.0.0">
+
+ <method rpc="canCreateNetwork" mode="sync">
+ <return status="success">
+ <parameter name="error-code" value="200" />
+ </return>
+ </method>
+
+ <method rpc="switchTester" mode="sync">
+
+ <switch test="`$test-value`">
+ <outcome value="">
+ <return status="success">
+ <parameter name="visited-outcome" value="empty string" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="success">
+ <parameter name="visited-outcome" value="Other" />
+ </return>
+ </outcome>
+ </switch>
+
+
+ </method>
+
+ <method rpc="forRecordTester" mode="sync">
+ <for index="i" start="0" end="1">
+ <record plugin="org.onap.ccsdk.sli.core.sli.provider.DummyRecorder">
+ <parameter name="level" value="INFO"/>
+ <parameter name="field1" value="`forRecordTester message $i`"/>
+ </record>
+ </for>
+ </method>
+
+ <method rpc="whileNodeTester" mode="sync">
+ <while test="`$test-value`">
+ <break/>
+ </while>
+
+ </method>
+
+ <method rpc="resourceTester" mode="sync">
+ <block>
+ <set>
+ <parameter name='resource-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.DummyResource' />
+ </set>
+
+ <save plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'">
+ <parameter name="sample-key" value="resourceTester.status"/>
+ <parameter name="sample-value" value="FAILED"/>
+ </save>
+
+ <update plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'">
+ <parameter name="sample-key" value="resourceTester.status"/>
+ <parameter name="sample-value" value="PASSED"/>
+ </update>
+
+ <get-resource plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'" pfx="sample"/>
+
+ <exists plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+ <is-available plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+ <reserve plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+ <release plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+
+ <reserve plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+ <notify plugin="`$resource-plugin`" resource="sample" action="RESERVE"/>
+
+ <delete plugin="`$resource-plugin`" resource="sample" key="sample-key == 'resourceTester.status'"/>
+
+
+
+ </block>
+ </method>
+
+ <method rpc="configureTester" mode="sync">
+ <block>
+ <set>
+ <parameter name='configure-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.DummyAdaptor' />
+ </set>
+ <configure adaptor="`$configure-plugin`" key="dummy" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="SUCCESS" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="ALREADY_ACTIVE" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="NOT_FOUND" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="NOT_READY" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="FAILURE" activate="true">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="dummy" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="SUCCESS" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="ALREADY_ACTIVE" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="NOT_FOUND" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="NOT_READY" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+ <configure adaptor="`$configure-plugin`" key="FAILURE" activate="false">
+ <parameter name="field1" value="1"/>
+ </configure>
+
+ </block>
+ </method>
+
+
+ <method rpc="javaPluginTester" mode="sync">
+ <block>
+ <set>
+ <parameter name='java-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.VoidDummyPlugin' />
+ </set>
+ <execute plugin="`$java-plugin`" method="dummy"/>
+ </block>
+ </method>
+
+ <method rpc="allNodesTester" mode="sync">
+ <block>
+ <set>
+ <parameter name='resource-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.DummyResource' />
+ <parameter name='configure-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.DummyAdaptor' />
+ <parameter name='java-plugin'
+ value='org.onap.ccsdk.sli.core.sli.provider.VoidDummyPlugin' />
+
+ </set>
+
+ <call rpc="switchTester" mode="sync" />
+
+ <call rpc="forRecordTester" mode="sync"/>
+
+ <call rpc="resourceTester" mode="sync"/>
+
+ <call rpc="configureTester" mode="sync"/>
+
+ <call rpc="javaPluginTester" mode="sync"/>
+
+ <call rpc="whileNodeTester" mode="sync"/>
+
+ </block>
+ </method>
+
+ <method rpc="networkCreated" mode="sync">
+ <switch
+ test="length($network.segment[0].provider-physical-network) >= 5 and substr($network.segment[0].provider-physical-network,0,5) == 'dvspg'">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="$vlanlist"
+ value="$network.segment[0].provider-segmentation-id" />
+ </set>
+ <for index="i" start="1" end="$network.num-segments">
+ <set>
+ <parameter name="$vlanlist"
+ value="eval($vlanlist+','+$network.segment[i].provider-segmentation-id)" />
+ </set>
+ </for>
+
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="success">
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ </switch>
+ </method>
+
+</service-logic>
diff --git a/sli/common/src/test/resources/parser-good.tests b/sli/common/src/test/resources/parser-good.tests
index 06543126..4147fdb6 100755
--- a/sli/common/src/test/resources/parser-good.tests
+++ b/sli/common/src/test/resources/parser-good.tests
@@ -1,2 +1,3 @@
ReleasePortSvcLogic_v101.xml
neutron_logic_v10.xml
+l3sdn_logic_v10.xml
diff --git a/sli/common/src/test/resources/svclogic.properties b/sli/common/src/test/resources/svclogic.properties
index 33d7ae6e..426960f7 100644
--- a/sli/common/src/test/resources/svclogic.properties
+++ b/sli/common/src/test/resources/svclogic.properties
@@ -20,7 +20,8 @@
###
org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://localhost:3306/test
-org.onap.ccsdk.sli.jdbc.database = test
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+org.onap.ccsdk.sli.jdbc.database = sdnctl
org.onap.ccsdk.sli.jdbc.user = test
-org.onap.ccsdk.sli.jdbc.password = test123
+org.onap.ccsdk.sli.jdbc.password = test
diff --git a/sli/common/src/test/resources/svclogic.xsd b/sli/common/src/test/resources/svclogic.xsd
index a63758f7..2704de88 100755
--- a/sli/common/src/test/resources/svclogic.xsd
+++ b/sli/common/src/test/resources/svclogic.xsd
@@ -30,6 +30,7 @@
<xsd:element ref="call" />
<xsd:element ref="notify" />
<xsd:element ref="break" />
+ <xsd:element ref="while" />
</xsd:choice>
</xsd:group>
@@ -320,4 +321,14 @@
<xsd:complexType />
</xsd:element>
+ <xsd:element name="while">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:group ref="node" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="test" use="required" type="xsd:string" />
+ <xsd:attribute name="do" use="optional" type="xsd:boolean" />
+ </xsd:complexType>
+ </xsd:element>
+
</xsd:schema>
diff --git a/sli/provider/pom.xml b/sli/provider/pom.xml
index 4a90ae00..1b21b002 100755
--- a/sli/provider/pom.xml
+++ b/sli/provider/pom.xml
@@ -1,44 +1,40 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-provider</artifactId>
- <version>0.2.1-SNAPSHOT</version>
- <packaging>bundle</packaging>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
- <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
- <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description>
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+ <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description>
- <properties>
+ <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>1.6.1</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>ch.vorburger.mariaDB4j</groupId>
- <artifactId>mariaDB4j</artifactId>
- <version>2.2.3</version>
- <scope>test</scope>
- </dependency>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-model</artifactId>
@@ -62,11 +58,6 @@
<version>${slf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons.lang.version}</version>
@@ -74,23 +65,28 @@
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
-
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.11.1.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/sli/provider/src/main/resources/svclogic.properties b/sli/provider/src/main/resources/svclogic.properties
deleted file mode 100644
index 49d39ab4..00000000
--- a/sli/provider/src/main/resources/svclogic.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ONAP : CCSDK
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. 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=========================================================
-###
-
-org.onap.ccsdk.sli.dbtype = dblib
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
-org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-org.onap.ccsdk.sli.jdbc.database = sdnctl
diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
index 4c112ab2..0a8bf71a 100644
--- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
+++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
@@ -24,8 +24,7 @@ package org.onap.ccsdk.sli.core.sli.provider;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
-import ch.vorburger.mariadb4j.DB;
-import ch.vorburger.mariadb4j.DBConfigurationBuilder;
+
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -40,6 +39,7 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;
import org.onap.ccsdk.sli.core.sli.SvcLogicParser;
@@ -74,6 +74,7 @@ public class ITCaseSvcLogicGraphExecutor {
put("set", new SetNodeExecutor());
put("switch", new SwitchNodeExecutor());
put("update", new UpdateNodeExecutor());
+ put("while", new WhileNodeExecutor());
}
};
@@ -88,16 +89,6 @@ public class ITCaseSvcLogicGraphExecutor {
Properties svcprops = new Properties();
svcprops.load(propStr);
- // Start MariaDB4j database
- DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder();
- config.setPort(0); // 0 => autom. detect free port
- DB db = DB.newEmbeddedDB(config.build());
- db.start();
-
- // Override jdbc URL and database name
- svcprops.setProperty("org.onap.ccsdk.sli.jdbc.database", "test");
- svcprops.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test"));
-
SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
assertNotNull(store);
@@ -144,18 +135,9 @@ public class ITCaseSvcLogicGraphExecutor {
Properties svcprops = new Properties();
svcprops.load(propStr);
- // Start MariaDB4j database
- DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder();
- config.setPort(0); // 0 => autom. detect free port
- DB db = DB.newEmbeddedDB(config.build());
- db.start();
-
- // Override jdbc URL and database name
- svcprops.setProperty("org.onap.ccsdk.sli.jdbc.database", "test");
- svcprops.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test"));
-
SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
+
assertNotNull(store);
@@ -214,10 +196,13 @@ public class ITCaseSvcLogicGraphExecutor {
fail("Could not resolve test case file " + testCaseFile);
}
+
LinkedList<SvcLogicGraph> graphs = parser.parse(testCaseUrl.getPath());
assertNotNull(graphs);
+ // Load grqphs into db to support call node
+ parser.load(testCaseUrl.getPath(), store);
for (SvcLogicGraph graph : graphs) {
if (graph.getRpc().equals(testCaseMethod)) {
Properties props = ctx.toProperties();
diff --git a/sli/provider/src/test/resources/executor.tests b/sli/provider/src/test/resources/executor.tests
index e4e60208..5468c8d6 100755
--- a/sli/provider/src/test/resources/executor.tests
+++ b/sli/provider/src/test/resources/executor.tests
@@ -1,6 +1,8 @@
l3sdn_logic_v10.xml:switchTester:test-value=""
l3sdn_logic_v10.xml:switchTester:test-value="hi"
l3sdn_logic_v10.xml:forRecordTester
+l3sdn_logic_v10.xml:whileNodeTester
l3sdn_logic_v10.xml:resourceTester
l3sdn_logic_v10.xml:configureTester
-l3sdn_logic_v10.xml:javaPluginTester \ No newline at end of file
+l3sdn_logic_v10.xml:javaPluginTester
+l3sdn_logic_v10.xml:allNodesTester \ No newline at end of file
diff --git a/sli/provider/src/test/resources/l3sdn_logic_v10.xml b/sli/provider/src/test/resources/l3sdn_logic_v10.xml
index 1386df10..cbb5db1b 100644
--- a/sli/provider/src/test/resources/l3sdn_logic_v10.xml
+++ b/sli/provider/src/test/resources/l3sdn_logic_v10.xml
@@ -49,6 +49,27 @@
</for>
</method>
+ <method rpc="whileNodeTester" mode="sync">
+ <block>
+ <set>
+ <parameter name="counter" value="0" />
+
+ </set>
+ <while test="`$counter &lt; 10`">
+ <set>
+ <parameter name="counter" value="`$counter + 1`" />
+ </set>
+
+ <switch test="`$counter > 6`">
+ <outcome value="true">
+ <break />
+ </outcome>
+ </switch>
+ </while>
+ </block>
+
+ </method>
+
<method rpc="resourceTester" mode="sync">
<block>
<set>
@@ -167,6 +188,8 @@
<call rpc="javaPluginTester" mode="sync"/>
+ <call rpc="whileNodeTester" mode="sync"/>
+
</block>
</method>
diff --git a/sli/provider/src/test/resources/svclogic.properties b/sli/provider/src/test/resources/svclogic.properties
index 49d39ab4..426960f7 100644
--- a/sli/provider/src/test/resources/svclogic.properties
+++ b/sli/provider/src/test/resources/svclogic.properties
@@ -19,7 +19,9 @@
# ============LICENSE_END=========================================================
###
-org.onap.ccsdk.sli.dbtype = dblib
+org.onap.ccsdk.sli.dbtype = jdbc
org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
org.onap.ccsdk.sli.jdbc.database = sdnctl
+org.onap.ccsdk.sli.jdbc.user = test
+org.onap.ccsdk.sli.jdbc.password = test