summaryrefslogtreecommitdiffstats
path: root/distribution/standalone/src/main/assembly
diff options
context:
space:
mode:
authorMurali-P <murali.p@huawei.com>2017-01-30 20:25:40 +0530
committerMurali-P <murali.p@huawei.com>2017-01-31 10:30:07 +0530
commit3075304c7f0a4814e2de297fb6ca54e48ffe7b91 (patch)
treeece70a3fd823d98d68c5142b7e85da8d4d07f803 /distribution/standalone/src/main/assembly
parentf4a9f582e9dc1fb064e650f8934e8a402749d6bb (diff)
VNF SDK Function test init Code
Resolved:VNFSDK-21 Function test base code Change-Id: Ib8070d0549acdea4775bd325c5a282d5e2a708e0 Signed-off-by: Murali-P <murali.p@huawei.com>
Diffstat (limited to 'distribution/standalone/src/main/assembly')
-rw-r--r--distribution/standalone/src/main/assembly/conf/vnfsdkfunctest.yml61
-rw-r--r--distribution/standalone/src/main/assembly/find_kill_process.bat9
-rw-r--r--distribution/standalone/src/main/assembly/run.bat25
-rw-r--r--distribution/standalone/src/main/assembly/run.sh19
-rw-r--r--distribution/standalone/src/main/assembly/stop.bat19
-rw-r--r--distribution/standalone/src/main/assembly/stop.sh28
6 files changed, 161 insertions, 0 deletions
diff --git a/distribution/standalone/src/main/assembly/conf/vnfsdkfunctest.yml b/distribution/standalone/src/main/assembly/conf/vnfsdkfunctest.yml
new file mode 100644
index 0000000..e4e00d0
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/conf/vnfsdkfunctest.yml
@@ -0,0 +1,61 @@
+
+template: Hello, %s!
+
+defaultName: ${DW_DEFAULT_NAME:-Stranger}
+
+msbServerAddr: http://127.0.0.1:80
+#database
+database:
+
+ # the name of your JDBC driver
+ driverClass: com.mysql.jdbc.Driver
+
+ # the username
+ user: functest
+
+ # the password
+ password: functest
+
+ # the JDBC URL
+ url: jdbc:mysql://127.0.0.1:3306/functest
+
+# use the simple server factory if you only want to run on a single port
+#server:
+# type: simple
+# connector:
+# type: http
+# port: 8080
+server:
+ type: simple
+ rootPath: '/openoapi/vnfsdk/v1/*'
+ applicationContextPath: /
+ adminContextPath: /admin
+ connector:
+ type: http
+ port: 8100
+
+# Logging settings.
+logging:
+
+ # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
+ level: ALL
+
+ # Logger-specific levels.
+ loggers:
+
+ # Sets the level for 'com.example.app' to DEBUG.
+ org.openo.vnfsdk.functest.VnfSdkFunTestApp: INFO
+
+ appenders:
+ - type: console
+ threshold: INFO
+ timeZone: UTC
+ logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
+ - type: file
+ threshold: INFO
+ logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
+ currentLogFilename: ./works/logs/vnfsdk.log
+ archivedLogFilenamePattern: ./works/logs/zip/vnfsdk-%d{yyyy-MM-dd}.log.gz
+ archivedFileCount: 7
+ timeZone: UTC
+
diff --git a/distribution/standalone/src/main/assembly/find_kill_process.bat b/distribution/standalone/src/main/assembly/find_kill_process.bat
new file mode 100644
index 0000000..4a4baaf
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/find_kill_process.bat
@@ -0,0 +1,9 @@
+
+echo %1 | findstr %2 >NUL
+echo ERRORLEVEL=%ERRORLEVEL%
+IF ERRORLEVEL 1 goto findend
+for /f "tokens=1" %%a in (%1) do (
+ echo kill %1
+ taskkill /F /pid %%a
+)
+:findend \ No newline at end of file
diff --git a/distribution/standalone/src/main/assembly/run.bat b/distribution/standalone/src/main/assembly/run.bat
new file mode 100644
index 0000000..3ce5172
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/run.bat
@@ -0,0 +1,25 @@
+
+@echo off
+title vnfsdk-functest
+
+set RUNHOME=%~dp0
+echo ### RUNHOME: %RUNHOME%
+echo ### Starting vnfsdk-functest
+
+set JAVA="%JAVA_HOME%\bin\java.exe"
+set port=8312
+set jvm_opts=-Xms50m -Xmx128m
+rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
+set class_path=%RUNHOME%;%RUNHOME%vnf-sdk-function-test.jar
+echo ### jvm_opts: %jvm_opts%
+echo ### class_path: %class_path%
+
+%JAVA% -classpath %class_path% %jvm_opts% org.openo.vnfsdk.functest.VnfSdkFuncTestApp server %RUNHOME%conf/vnfsdkfunctest.yml
+
+IF ERRORLEVEL 1 goto showerror
+exit
+:showerror
+echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!
+echo After checking, press any key to close
+pause
+exit \ No newline at end of file
diff --git a/distribution/standalone/src/main/assembly/run.sh b/distribution/standalone/src/main/assembly/run.sh
new file mode 100644
index 0000000..b20c252
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/run.sh
@@ -0,0 +1,19 @@
+
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+echo @JAVA_HOME@ $JAVA_HOME
+JAVA="$JAVA_HOME/bin/java"
+echo @JAVA@ $JAVA
+
+JAVA_OPTS="-Xms50m -Xmx128m"
+port=8312
+#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n"
+echo @JAVA_OPTS@ $JAVA_OPTS
+
+class_path="$RUNHOME/:$RUNHOME/org.openo.vnfsdk.functest.jar"
+echo @class_path@ $class_path
+
+"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.vnfsdk.functest.VnfSdkFuncTestApp server "$RUNHOME/conf/vnfsdkfunctest.yml"
+
diff --git a/distribution/standalone/src/main/assembly/stop.bat b/distribution/standalone/src/main/assembly/stop.bat
new file mode 100644
index 0000000..c075ac1
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/stop.bat
@@ -0,0 +1,19 @@
+
+@echo off
+title stopping vnfsdk-functest
+
+set HOME=%~dp0
+set Main_Class="org.openo.vnfsdk.functest.VnfSdkFuncTestApp"
+
+echo ================== extsys-service info =============================================
+echo HOME=$HOME
+echo Main_Class=%Main_Class%
+echo ===============================================================================
+
+echo ### Stopping vnfsdk-functest
+cd /d %HOME%
+
+for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do (
+ call find_kill_process "%%i" %Main_Class%
+)
+exit \ No newline at end of file
diff --git a/distribution/standalone/src/main/assembly/stop.sh b/distribution/standalone/src/main/assembly/stop.sh
new file mode 100644
index 0000000..0080d41
--- /dev/null
+++ b/distribution/standalone/src/main/assembly/stop.sh
@@ -0,0 +1,28 @@
+
+DIRNAME=`dirname $0`
+HOME=`cd $DIRNAME/; pwd`
+Main_Class="org.openo.vnfsdk.functest.VnfSdkFuncTestApp"
+
+echo ================== catalog-service info =============================================
+echo HOME=$HOME
+echo Main_Class=$Main_Class
+echo ===============================================================================
+cd $HOME; pwd
+
+echo @WORK_DIR@ $HOME
+
+function save_service_pid(){
+ service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'`
+ echo @service_pid@ $service_pid
+}
+
+function kill_service_process(){
+ ps -p $service_pid
+ if [ $? == 0 ]; then
+ kill -9 $service_pid
+ fi
+}
+
+save_service_pid;
+echo @C_CMD@ kill -9 $service_pid
+kill_service_process;