add chrome-renderer execute app 71/206071/1
authorwansuyoo <wansu.yoo@samsung.com>
Tue, 14 May 2019 05:19:23 +0000 (14:19 +0900)
committerwansuyoo <wansu.yoo@samsung.com>
Tue, 14 May 2019 05:24:28 +0000 (14:24 +0900)
re-define role of configuration member
- AppName: Unique name of app to distinguish
- ExecBinary: Execute full command with parameters

Change-Id: I70b71158c277d5ec5535ec8eece10ac2128d5a87
Signed-off-by: wansuyoo <wansu.yoo@samsung.com>
44 files changed:
.gitignore
Makefile
packaging/edge-orchestration.spec
src/CMain/inc/linux_aarch64/orchestration.h
src/CMain/inc/linux_arm/orchestration.h
src/CMain/inc/linux_x86-64/orchestration.h
src/CMain/inc/linux_x86/orchestration.h
src/CMain/lib/linux_aarch64/liborchestration.a
src/CMain/lib/linux_arm/liborchestration.a
src/CMain/lib/linux_x86-64/liborchestration.a
src/CMain/lib/linux_x86/liborchestration.a
src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190429.1714.h [deleted file]
src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190514.1301.h [new file with mode: 0644]
src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190429.1714.h [deleted file]
src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190514.1301.h [new file with mode: 0644]
src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190429.1706.h [deleted file]
src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190514.1259.h [new file with mode: 0644]
src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190429.1714.h [deleted file]
src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190514.1301.h [new file with mode: 0644]
src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190429.1714.a [deleted file]
src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190514.1301.a [new file with mode: 0644]
src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190429.1714.a [deleted file]
src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190514.1301.a [new file with mode: 0644]
src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190429.1706.a [deleted file]
src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190514.1259.a [new file with mode: 0644]
src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190429.1714.a [deleted file]
src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190514.1301.a [new file with mode: 0644]
src/libedge-orchestration/Makefile
src/libedge-orchestration/sample/main.c
src/libedge-orchestration/sample/main_chrome.c [new file with mode: 0755]
src/restapi/httpclient/internal_test.go
src/restapi/v1/restapi.go
src/restapi/v1/restapi_test.go
src/scoringmgr/mock/myscoring/libmyscoring.so.1.0.1
src/scoringmgr/mock/myscoring/myscoring.conf [changed mode: 0644->0755]
src/scoringmgr/mock/myscoring2/Makefile [new file with mode: 0755]
src/scoringmgr/mock/myscoring2/libmyscoring.so.1.0.1 [deleted file]
src/scoringmgr/mock/myscoring2/libmyscoring2.so
src/scoringmgr/mock/myscoring2/libmyscoring2.so.1.0.1 [new file with mode: 0755]
src/scoringmgr/mock/myscoring2/myscoring.c [changed mode: 0644->0755]
src/scoringmgr/mock/myscoring2/myscoring2.conf [changed mode: 0644->0755]
src/servicemgr/service_execution.go
src/servicemgr/servicemgr.go
src/servicemgr/servicemgr_test.go

index 566d03ca894c17caf132ca99ff5b24ebc1dee185..bd916b630621366766749c20cf73604390438c31 100644 (file)
@@ -13,14 +13,19 @@ doc/generate-api/*
 # Sample binary
 src/libedge-orchestration/lib/*
 src/libedge-orchestration/sample/orchestration_sample
+src/libedge-orchestration/sample/orchestration_chrome_sample
 
 # Test binary, build with `go test -c`
 *.test
 
 # Output of c build 
 *.o
+src/CMain/unittest/out/*
 src/CMain/bin/*
 
+# Output of go build
+src/GoMain/bin/*
+
 # Output of the go coverage tool, specifically when used with LiteIDE
 *.out
 *.html
index be0b678f7677751404c657181ec3c76aea53ea06..1dbaf324a7e9adbadc457e0b90e90039a55f4ca5 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -84,6 +84,12 @@ LIBSCORE_SAMPLE_VER          := 1.0.1
 LIBSCORE_SAMPLE_CONF   := myscoring.conf
 LIBSCORE_SAMPLE_DIR            := $(BASE_DIR)/src/scoringmgr/mock/myscoring
 
+LIBSCORE_SAMPLE_2                      := myscoring2
+LIBSCORE_SAMPLE_2_LIBRARY      := libmyscoring2.so
+LIBSCORE_SAMPLE_2_VER          := 1.0.1
+LIBSCORE_SAMPLE_2_CONF         := myscoring2.conf
+LIBSCORE_SAMPLE_2_DIR          := $(BASE_DIR)/src/scoringmgr/mock/myscoring2
+
 
 
 .DEFAULT_GOAL := help
@@ -113,6 +119,7 @@ build-dbus-client:
        ls -al $(LIBPKG_LIB_DIR)
        ls -al $(LIBPKG_INC_DIR)
        $(MAKE) -C $(LIBSCORE_SAMPLE_DIR)
+       $(MAKE) -C $(LIBSCORE_SAMPLE_2_DIR)
 
 ## install output files for packaing
 install:
@@ -125,6 +132,7 @@ install:
        install -d $(DESTDIR)/etc/dbus-1/system.d
        install -m 755 $(CMAIN_BIN_DIR)/$(CMAIN_BIN_FILE) $(DESTDIR)/usr/bin/$(CMAIN_BIN_FILE)
        install -m 755 $(LIBPKG_SAMPLE_DIR)/orchestration_sample $(DESTDIR)/usr/bin/orchestration_sample
+       install -m 755 $(LIBPKG_SAMPLE_DIR)/orchestration_chrome_sample $(DESTDIR)/usr/bin/orchestration_chrome_sample
        install -m 644 $(BASE_DIR)/$(SERVICE_FILE) $(DESTDIR)/usr/lib/systemd/system/$(SERVICE_FILE)
        ln -s ../$(SERVICE_FILE) $(DESTDIR)/usr/lib/systemd/system/multi-user.target.wants/
 
@@ -137,9 +145,11 @@ install:
        install -m 644 $(LIBPKG_INC_DIR)/$(LIBPKG_HEADER_FILE) $(DESTDIR)/usr/include/$(PKG_NAME)
 
        install -d $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE)
+       install -d $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE_2)
        install -m 644 $(LIBSCORE_SAMPLE_DIR)/$(LIBSCORE_SAMPLE_CONF) $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE)/
-#      install -m 644 $(LIBSCORE_SAMPLE_DIR)/$(LIBSCORE_SAMPLE_LIBRARY) $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE)/
+       install -m 644 $(LIBSCORE_SAMPLE_2_DIR)/$(LIBSCORE_SAMPLE_2_CONF) $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE_2)/
        install -m 644 $(LIBSCORE_SAMPLE_DIR)/$(LIBSCORE_SAMPLE_LIBRARY).$(LIBSCORE_SAMPLE_VER) $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE)/
+       install -m 644 $(LIBSCORE_SAMPLE_2_DIR)/$(LIBSCORE_SAMPLE_2_LIBRARY).$(LIBSCORE_SAMPLE_2_VER) $(DESTDIR)/etc/$(PKG_NAME)/$(LIBSCORE_SAMPLE_2)/
 
 ## go test and coverage
 test:
index 87aaadf88fe27bf062dc8cffb1dbf763a58d34ae..e4e97e351697adb97dcb58a58f26624110f7ba0c 100755 (executable)
@@ -97,6 +97,7 @@ systemctl restart %{name}
 
 %post -n libedge-orchestration
 ln -sf %{_sysconfdir}/%{name}/myscoring/libmyscoring.so.1.0.1 %{_sysconfdir}/%{name}/myscoring/libmyscoring.so
+ln -sf %{_sysconfdir}/%{name}/myscoring2/libmyscoring2.so.1.0.1 %{_sysconfdir}/%{name}/myscoring2/libmyscoring2.so
 
 %files
 %manifest %{name}.manifest
@@ -114,7 +115,9 @@ ln -sf %{_sysconfdir}/%{name}/myscoring/libmyscoring.so.1.0.1 %{_sysconfdir}/%{n
 %attr(755,system_fw,system_fw)%{_libdir}/liborchestration-client.so
 # orchestration sample
 %attr(755,system_fw,system_fw)%{_bindir}/orchestration_sample
+%attr(755,system_fw,system_fw)%{_bindir}/orchestration_chrome_sample
 %attr(755,system_fw,system_fw)%{_sysconfdir}/%{name}/myscoring/*
+%attr(755,system_fw,system_fw)%{_sysconfdir}/%{name}/myscoring2/*
 
 %files -n libedge-orchestration-devel
 %manifest lib%{name}.manifest
index 2a3a420d9e42efdc709c2f2b21088f5093a5d683..9f9712e1ddfb76cb2b381f25ca628e59a8270149 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190429.1714.h
\ No newline at end of file
+../../../interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190514.1301.h
\ No newline at end of file
index ff7372d86e200a9a80260f8ac8fe3b658d8a1d02..e11f5dd1b2a7843122fe3aec824483de7a8320c7 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/inc/linux_arm/liborchestration-0.0.1-20190429.1714.h
\ No newline at end of file
+../../../interface/output/inc/linux_arm/liborchestration-0.0.1-20190514.1301.h
\ No newline at end of file
index 817ad8aaceb4caaa1f94a85b268e022578cd3264..41849227cb51074da380ae87583fd2000278c67c 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190429.1706.h
\ No newline at end of file
+../../../interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190514.1259.h
\ No newline at end of file
index 4c21ef6488b4d8acfc83976d8a15cda94e166b95..f1c05a7c55ca7b58dd0232c5c029b801fce2ef63 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/inc/linux_x86/liborchestration-0.0.1-20190429.1714.h
\ No newline at end of file
+../../../interface/output/inc/linux_x86/liborchestration-0.0.1-20190514.1301.h
\ No newline at end of file
index f6157f3a28200d5eae211d0ef2c9e22dee9f8a15..958c363bf34433f11544ac0734ae28abb7aedd81 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190429.1714.a
\ No newline at end of file
+../../../interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190514.1301.a
\ No newline at end of file
index 11d2f3adde5f1ce15b9e17522c4e4df957c3fc31..6fa4b6bd7ed18736e9684bac18c0604ad701ddf4 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/lib/linux_arm/liborchestration-0.0.1-20190429.1714.a
\ No newline at end of file
+../../../interface/output/lib/linux_arm/liborchestration-0.0.1-20190514.1301.a
\ No newline at end of file
index 1f8086930316af9a7595aaa38f4d7a0bfdd3ad9e..8a82af661bcbc4c84afcb6ff6d54d2fcef41c880 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190429.1706.a
\ No newline at end of file
+../../../interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190514.1259.a
\ No newline at end of file
index 91288dd25ea6b08400a328adc2041005d0130e1f..244edcfdfe7cded6fd1b33a094b1392f48626009 120000 (symlink)
@@ -1 +1 @@
-../../../interface/output/lib/linux_x86/liborchestration-0.0.1-20190429.1714.a
\ No newline at end of file
+../../../interface/output/lib/linux_x86/liborchestration-0.0.1-20190514.1301.a
\ No newline at end of file
diff --git a/src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190429.1714.h b/src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190429.1714.h
deleted file mode 100644 (file)
index a5e6e0f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package interface */
-
-
-#line 1 "cgo-builtin-prolog"
-
-#include <stddef.h> /* for ptrdiff_t below */
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 29 "main.go"
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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.
- *
- *******************************************************************************/
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt64 GoInt;
-typedef GoUint64 GoUint;
-typedef __SIZE_TYPE__ GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
-
-typedef _GoString_ GoString;
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-extern int OrchestrationInit();
-
-extern int OrchestrationRequestService(char* p0, char* p1);
-
-extern int PrintLog(char* p0);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190514.1301.h b/src/interface/output/inc/linux_aarch64/liborchestration-0.0.1-20190514.1301.h
new file mode 100644 (file)
index 0000000..a5e6e0f
--- /dev/null
@@ -0,0 +1,95 @@
+/* Code generated by cmd/cgo; DO NOT EDIT. */
+
+/* package interface */
+
+
+#line 1 "cgo-builtin-prolog"
+
+#include <stddef.h> /* for ptrdiff_t below */
+
+#ifndef GO_CGO_EXPORT_PROLOGUE_H
+#define GO_CGO_EXPORT_PROLOGUE_H
+
+typedef struct { const char *p; ptrdiff_t n; } _GoString_;
+
+#endif
+
+/* Start of preamble from import "C" comments.  */
+
+
+#line 29 "main.go"
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics 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.
+ *
+ *******************************************************************************/
+
+#line 1 "cgo-generated-wrapper"
+
+
+/* End of preamble from import "C" comments.  */
+
+
+/* Start of boilerplate cgo prologue.  */
+#line 1 "cgo-gcc-export-header-prolog"
+
+#ifndef GO_CGO_PROLOGUE_H
+#define GO_CGO_PROLOGUE_H
+
+typedef signed char GoInt8;
+typedef unsigned char GoUint8;
+typedef short GoInt16;
+typedef unsigned short GoUint16;
+typedef int GoInt32;
+typedef unsigned int GoUint32;
+typedef long long GoInt64;
+typedef unsigned long long GoUint64;
+typedef GoInt64 GoInt;
+typedef GoUint64 GoUint;
+typedef __SIZE_TYPE__ GoUintptr;
+typedef float GoFloat32;
+typedef double GoFloat64;
+typedef float _Complex GoComplex64;
+typedef double _Complex GoComplex128;
+
+/*
+  static assertion to make sure the file is being used on architecture
+  at least with matching size of GoInt.
+*/
+typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
+
+typedef _GoString_ GoString;
+typedef void *GoMap;
+typedef void *GoChan;
+typedef struct { void *t; void *v; } GoInterface;
+typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
+
+#endif
+
+/* End of boilerplate cgo prologue.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int OrchestrationInit();
+
+extern int OrchestrationRequestService(char* p0, char* p1);
+
+extern int PrintLog(char* p0);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190429.1714.h b/src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190429.1714.h
deleted file mode 100644 (file)
index e7df745..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package interface */
-
-
-#line 1 "cgo-builtin-prolog"
-
-#include <stddef.h> /* for ptrdiff_t below */
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 29 "main.go"
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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.
- *
- *******************************************************************************/
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt32 GoInt;
-typedef GoUint32 GoUint;
-typedef __SIZE_TYPE__ GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
-
-typedef _GoString_ GoString;
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-extern int OrchestrationInit();
-
-extern int OrchestrationRequestService(char* p0, char* p1);
-
-extern int PrintLog(char* p0);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190514.1301.h b/src/interface/output/inc/linux_arm/liborchestration-0.0.1-20190514.1301.h
new file mode 100644 (file)
index 0000000..e7df745
--- /dev/null
@@ -0,0 +1,95 @@
+/* Code generated by cmd/cgo; DO NOT EDIT. */
+
+/* package interface */
+
+
+#line 1 "cgo-builtin-prolog"
+
+#include <stddef.h> /* for ptrdiff_t below */
+
+#ifndef GO_CGO_EXPORT_PROLOGUE_H
+#define GO_CGO_EXPORT_PROLOGUE_H
+
+typedef struct { const char *p; ptrdiff_t n; } _GoString_;
+
+#endif
+
+/* Start of preamble from import "C" comments.  */
+
+
+#line 29 "main.go"
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics 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.
+ *
+ *******************************************************************************/
+
+#line 1 "cgo-generated-wrapper"
+
+
+/* End of preamble from import "C" comments.  */
+
+
+/* Start of boilerplate cgo prologue.  */
+#line 1 "cgo-gcc-export-header-prolog"
+
+#ifndef GO_CGO_PROLOGUE_H
+#define GO_CGO_PROLOGUE_H
+
+typedef signed char GoInt8;
+typedef unsigned char GoUint8;
+typedef short GoInt16;
+typedef unsigned short GoUint16;
+typedef int GoInt32;
+typedef unsigned int GoUint32;
+typedef long long GoInt64;
+typedef unsigned long long GoUint64;
+typedef GoInt32 GoInt;
+typedef GoUint32 GoUint;
+typedef __SIZE_TYPE__ GoUintptr;
+typedef float GoFloat32;
+typedef double GoFloat64;
+typedef float _Complex GoComplex64;
+typedef double _Complex GoComplex128;
+
+/*
+  static assertion to make sure the file is being used on architecture
+  at least with matching size of GoInt.
+*/
+typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
+
+typedef _GoString_ GoString;
+typedef void *GoMap;
+typedef void *GoChan;
+typedef struct { void *t; void *v; } GoInterface;
+typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
+
+#endif
+
+/* End of boilerplate cgo prologue.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int OrchestrationInit();
+
+extern int OrchestrationRequestService(char* p0, char* p1);
+
+extern int PrintLog(char* p0);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190429.1706.h b/src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190429.1706.h
deleted file mode 100644 (file)
index a5e6e0f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package interface */
-
-
-#line 1 "cgo-builtin-prolog"
-
-#include <stddef.h> /* for ptrdiff_t below */
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 29 "main.go"
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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.
- *
- *******************************************************************************/
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt64 GoInt;
-typedef GoUint64 GoUint;
-typedef __SIZE_TYPE__ GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
-
-typedef _GoString_ GoString;
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-extern int OrchestrationInit();
-
-extern int OrchestrationRequestService(char* p0, char* p1);
-
-extern int PrintLog(char* p0);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190514.1259.h b/src/interface/output/inc/linux_x86-64/liborchestration-0.0.1-20190514.1259.h
new file mode 100644 (file)
index 0000000..a5e6e0f
--- /dev/null
@@ -0,0 +1,95 @@
+/* Code generated by cmd/cgo; DO NOT EDIT. */
+
+/* package interface */
+
+
+#line 1 "cgo-builtin-prolog"
+
+#include <stddef.h> /* for ptrdiff_t below */
+
+#ifndef GO_CGO_EXPORT_PROLOGUE_H
+#define GO_CGO_EXPORT_PROLOGUE_H
+
+typedef struct { const char *p; ptrdiff_t n; } _GoString_;
+
+#endif
+
+/* Start of preamble from import "C" comments.  */
+
+
+#line 29 "main.go"
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics 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.
+ *
+ *******************************************************************************/
+
+#line 1 "cgo-generated-wrapper"
+
+
+/* End of preamble from import "C" comments.  */
+
+
+/* Start of boilerplate cgo prologue.  */
+#line 1 "cgo-gcc-export-header-prolog"
+
+#ifndef GO_CGO_PROLOGUE_H
+#define GO_CGO_PROLOGUE_H
+
+typedef signed char GoInt8;
+typedef unsigned char GoUint8;
+typedef short GoInt16;
+typedef unsigned short GoUint16;
+typedef int GoInt32;
+typedef unsigned int GoUint32;
+typedef long long GoInt64;
+typedef unsigned long long GoUint64;
+typedef GoInt64 GoInt;
+typedef GoUint64 GoUint;
+typedef __SIZE_TYPE__ GoUintptr;
+typedef float GoFloat32;
+typedef double GoFloat64;
+typedef float _Complex GoComplex64;
+typedef double _Complex GoComplex128;
+
+/*
+  static assertion to make sure the file is being used on architecture
+  at least with matching size of GoInt.
+*/
+typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
+
+typedef _GoString_ GoString;
+typedef void *GoMap;
+typedef void *GoChan;
+typedef struct { void *t; void *v; } GoInterface;
+typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
+
+#endif
+
+/* End of boilerplate cgo prologue.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int OrchestrationInit();
+
+extern int OrchestrationRequestService(char* p0, char* p1);
+
+extern int PrintLog(char* p0);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190429.1714.h b/src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190429.1714.h
deleted file mode 100644 (file)
index e7df745..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package interface */
-
-
-#line 1 "cgo-builtin-prolog"
-
-#include <stddef.h> /* for ptrdiff_t below */
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 29 "main.go"
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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.
- *
- *******************************************************************************/
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt32 GoInt;
-typedef GoUint32 GoUint;
-typedef __SIZE_TYPE__ GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
-
-typedef _GoString_ GoString;
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-extern int OrchestrationInit();
-
-extern int OrchestrationRequestService(char* p0, char* p1);
-
-extern int PrintLog(char* p0);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190514.1301.h b/src/interface/output/inc/linux_x86/liborchestration-0.0.1-20190514.1301.h
new file mode 100644 (file)
index 0000000..e7df745
--- /dev/null
@@ -0,0 +1,95 @@
+/* Code generated by cmd/cgo; DO NOT EDIT. */
+
+/* package interface */
+
+
+#line 1 "cgo-builtin-prolog"
+
+#include <stddef.h> /* for ptrdiff_t below */
+
+#ifndef GO_CGO_EXPORT_PROLOGUE_H
+#define GO_CGO_EXPORT_PROLOGUE_H
+
+typedef struct { const char *p; ptrdiff_t n; } _GoString_;
+
+#endif
+
+/* Start of preamble from import "C" comments.  */
+
+
+#line 29 "main.go"
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics 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.
+ *
+ *******************************************************************************/
+
+#line 1 "cgo-generated-wrapper"
+
+
+/* End of preamble from import "C" comments.  */
+
+
+/* Start of boilerplate cgo prologue.  */
+#line 1 "cgo-gcc-export-header-prolog"
+
+#ifndef GO_CGO_PROLOGUE_H
+#define GO_CGO_PROLOGUE_H
+
+typedef signed char GoInt8;
+typedef unsigned char GoUint8;
+typedef short GoInt16;
+typedef unsigned short GoUint16;
+typedef int GoInt32;
+typedef unsigned int GoUint32;
+typedef long long GoInt64;
+typedef unsigned long long GoUint64;
+typedef GoInt32 GoInt;
+typedef GoUint32 GoUint;
+typedef __SIZE_TYPE__ GoUintptr;
+typedef float GoFloat32;
+typedef double GoFloat64;
+typedef float _Complex GoComplex64;
+typedef double _Complex GoComplex128;
+
+/*
+  static assertion to make sure the file is being used on architecture
+  at least with matching size of GoInt.
+*/
+typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
+
+typedef _GoString_ GoString;
+typedef void *GoMap;
+typedef void *GoChan;
+typedef struct { void *t; void *v; } GoInterface;
+typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
+
+#endif
+
+/* End of boilerplate cgo prologue.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int OrchestrationInit();
+
+extern int OrchestrationRequestService(char* p0, char* p1);
+
+extern int PrintLog(char* p0);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190429.1714.a b/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190429.1714.a
deleted file mode 100644 (file)
index a76d2c2..0000000
Binary files a/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190429.1714.a and /dev/null differ
diff --git a/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190514.1301.a b/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190514.1301.a
new file mode 100644 (file)
index 0000000..745e623
Binary files /dev/null and b/src/interface/output/lib/linux_aarch64/liborchestration-0.0.1-20190514.1301.a differ
diff --git a/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190429.1714.a b/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190429.1714.a
deleted file mode 100644 (file)
index d87cc64..0000000
Binary files a/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190429.1714.a and /dev/null differ
diff --git a/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190514.1301.a b/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190514.1301.a
new file mode 100644 (file)
index 0000000..c13c3d6
Binary files /dev/null and b/src/interface/output/lib/linux_arm/liborchestration-0.0.1-20190514.1301.a differ
diff --git a/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190429.1706.a b/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190429.1706.a
deleted file mode 100644 (file)
index 88860d7..0000000
Binary files a/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190429.1706.a and /dev/null differ
diff --git a/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190514.1259.a b/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190514.1259.a
new file mode 100644 (file)
index 0000000..bcf4507
Binary files /dev/null and b/src/interface/output/lib/linux_x86-64/liborchestration-0.0.1-20190514.1259.a differ
diff --git a/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190429.1714.a b/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190429.1714.a
deleted file mode 100644 (file)
index ccfc482..0000000
Binary files a/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190429.1714.a and /dev/null differ
diff --git a/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190514.1301.a b/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190514.1301.a
new file mode 100644 (file)
index 0000000..3ad7d1e
Binary files /dev/null and b/src/interface/output/lib/linux_x86/liborchestration-0.0.1-20190514.1301.a differ
index b231f37635eca47f029b5b544094a828fe632364..1c19e77e88e99cf3be7eb44b3dc985765f7617aa 100755 (executable)
@@ -22,6 +22,7 @@ all: build build-sample
 
 build-sample: build
        $(CC) -Wall -fPIE -pie $(SAMPLE_DIR)/main.c -o $(SAMPLE_DIR)/orchestration_sample -I$(INC_DIR) -L$(LIB_DIR) -lorchestration-client `pkg-config --libs --cflags gio-2.0 gio-unix-2.0 glib-2.0`
+       $(CC) -Wall -fPIE -pie $(SAMPLE_DIR)/main_chrome.c -o $(SAMPLE_DIR)/orchestration_chrome_sample -I$(INC_DIR) -L$(LIB_DIR) -lorchestration-client `pkg-config --libs --cflags gio-2.0 gio-unix-2.0 glib-2.0`
        -rm -f ./sample/*.o
 
 build:
index c9b9cf6ea94cf8f9860fd0be0b50226d3285d033..489bccf39916fa1e4f3317f9997b6a56a6c49d35 100755 (executable)
@@ -25,7 +25,7 @@ void status_cb(orchestration_service_status_e staus, void* user_data)
 
 int main() {
     orchestration_service_info_s service_info;
-    service_info.exec_parameter = "-al";
-    orchestration_request_service("ls", service_info, status_cb, NULL);
+    service_info.exec_parameter = "ls -al";
+    orchestration_request_service("list_segments", service_info, status_cb, NULL);
     return 0;
 }
\ No newline at end of file
diff --git a/src/libedge-orchestration/sample/main_chrome.c b/src/libedge-orchestration/sample/main_chrome.c
new file mode 100755 (executable)
index 0000000..a43ce3c
--- /dev/null
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics 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.
+ *
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <orchestration_client.h>
+
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+
+int get_ip_addr(char ipstr[40]) {
+    int fd;
+    struct ifreq ifr;
+
+    fd = socket(AF_INET, SOCK_DGRAM, 0);
+    ifr.ifr_addr.sa_family = AF_INET;
+
+    /* I want IP address attached to "wlan0" */
+    strncpy(ifr.ifr_name, "wlan0", IFNAMSIZ-1);
+    ioctl(fd, SIOCGIFADDR, &ifr);
+    close(fd);
+
+    strcpy(ipstr, inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
+    return 0;
+}
+
+void status_cb(orchestration_service_status_e staus, void* user_data)
+{
+
+}
+
+int main() {
+    char command[256] = "/usr/share/chromium-efl/bin/efl_webprocess --type=renderer --enable-castanets=";
+    char ipstr[40] = {0, };
+    if (get_ip_addr(ipstr) != 0) {
+        printf("error from getting ip addr\n");
+        return 0;
+    }
+    orchestration_service_info_s service_info;
+    service_info.exec_parameter = strcat(command, ipstr);
+    printf("service_info.exec_parameter: %s\n", service_info.exec_parameter);
+    orchestration_request_service("org.tizen.chromium-efl", service_info, status_cb, NULL);
+    return 0;
+}
\ No newline at end of file
index 2feb0d476cb5f4119a39c7b78031944137cda523..1373943e87550033aa226e5113db9915cb003544 100644 (file)
@@ -45,10 +45,12 @@ var (
 
        targetCustomURL        = fmt.Sprintf("127.0.0.1:%d", httpclient.ConstWellknownPort)
        targetRemoteDeviceAddr = "127.0.0.1"
-       notExistFileName       = "NotExistFile"
        keyFilePath            = "../../securemgr/test/key.txt"
 
        serviceName = "ls"
+
+       userArgs         = []string{"ls", "-ail"}
+       userArgsNotExist = []string{"NotExistFile"}
 )
 
 func init() {
@@ -77,6 +79,7 @@ func TestDoExecuteRemoteDevice(t *testing.T) {
 
        appInfo := make(map[string]interface{})
        appInfo["ServiceName"] = serviceName
+       appInfo["UserArgs"] = userArgs
        appInfo["NotificationTargetURL"] = targetRemoteDeviceAddr
 
        err := httpclient.DoExecuteRemoteDevice(appInfo, targetRemoteDeviceAddr)
@@ -92,7 +95,8 @@ func TestDoExecuteRemoteDeviceWithInvalidApp(t *testing.T) {
        setUp()
 
        appInfo := make(map[string]interface{})
-       appInfo["ServiceName"] = notExistFileName
+       appInfo["ServiceName"] = serviceName
+       appInfo["UserArgs"] = userArgsNotExist
        err := httpclient.DoExecuteRemoteDevice(appInfo, targetRemoteDeviceAddr)
 
        log.Println("[err]", err)
index 44ab922df1924923e2f18be42337b0cdfd104344..bf09c4275bf3e5d3e96eb598dbe43d8b9483d625 100755 (executable)
@@ -195,7 +195,7 @@ func executeServiceHandler(w http.ResponseWriter, req *http.Request) (distServic
                return
        }
 
-       _, err = exec.LookPath(distService["ServiceName"].(string))
+       _, err = exec.LookPath((distService["UserArgs"].([]interface{}))[0].(string))
        if err != nil {
                err = errors.New("It is Invalid Service")
                return
index f28c4eb71659bb8c933c66471ae4f36ee99152e9..2803bd0fee5f9a2f20d246ebf57f5420a85694ef 100755 (executable)
@@ -49,15 +49,19 @@ const (
        // Scoring mgr URI
        ConstScoremgrScore = "/api/v1/scoringmgr/score"
 
-       ConstAppName         = "ls"
-       ConstNotExistAppName = "NotExistFile"
-       ConstTooLongAppName  = `00000000000000000000000000000000000000000000000000000000000000000000000000000000000
+       ConstAppName        = "ls"
+       ConstTooLongAppName = `00000000000000000000000000000000000000000000000000000000000000000000000000000000000
                                                        00000000000000000000000000000000000000000000000000000000000000000000000000000000000
                                                        00000000000000000000000000000000000000000000000000000000000000000000000000000000000
                                                        00000000000000000000000000000000000000000000000000000000000000000000000000000000000
                                                        00000000000000000000000000000000000000000000000000000000000000000000000000000000000`
 )
 
+var (
+       userArgs         = []string{"ls", "-ail"}
+       userArgsNotExist = []string{"invalidArgs"}
+)
+
 type Response struct {
        Content string
        Code    int
@@ -95,11 +99,11 @@ func TestAPIV1DiscoverymgrDevicesTXTPostWithInvalidAppName(t *testing.T) {
 }
 
 func TestAPIV1ServicemgrServicesPost(t *testing.T) {
-       executeService(t, ConstAppName, http.StatusOK)
+       executeService(t, ConstAppName, userArgs, http.StatusOK)
 }
 
 func TestAPIV1ServicemgrServicesPostWithNotExistExecutionFile(t *testing.T) {
-       executeService(t, ConstNotExistAppName, http.StatusBadRequest)
+       executeService(t, ConstAppName, userArgsNotExist, http.StatusBadRequest)
 }
 
 func TestAPIV1ScoringmgrScoreLibnameGet(t *testing.T) {
@@ -178,7 +182,7 @@ func testPost(t *testing.T, targetURI string, bodyContents []byte, statusCode in
        return
 }
 
-func executeService(t *testing.T, appName string, expectedStatus int) {
+func executeService(t *testing.T, appName string, userArgs []string, expectedStatus int) {
        t.Helper()
        targetURI := ConstServicemgrServices
 
@@ -187,8 +191,6 @@ func executeService(t *testing.T, appName string, expectedStatus int) {
        appInfo["ServiceID"] = 1
        appInfo["ServiceName"] = appName
        appInfo["NotificationTargetURL"] = "URL"
-
-       userArgs := []string{"-ail"}
        appInfo["UserArgs"] = userArgs
 
        bdbytes, err := json.Marshal(appInfo)
index 0a6f3bd69cb3eb4527a5b87f795797a8005bf402..9b7ccbe152a1d8334fdded839857c8a9a4b7c8bd 100755 (executable)
Binary files a/src/scoringmgr/mock/myscoring/libmyscoring.so.1.0.1 and b/src/scoringmgr/mock/myscoring/libmyscoring.so.1.0.1 differ
old mode 100644 (file)
new mode 100755 (executable)
index bd84c46..7994425
@@ -3,7 +3,7 @@
 ConfVersion=v0.0                                        ; Version of Configuration file
 
 [ServiceInfo]
-ServiceName=ls                              ; Name of distributed service
+ServiceName=list_segments                              ; Name of distributed service
 
 [ScoringMethod]
 LibFile=./libmyscoring.so                               ; Library file name
diff --git a/src/scoringmgr/mock/myscoring2/Makefile b/src/scoringmgr/mock/myscoring2/Makefile
new file mode 100755 (executable)
index 0000000..3360ae7
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Makefile
+#
+
+# Target parameters
+LIBRARY_FILE   := libmyscoring2.so
+LIBRARY_VER            := 1.0.1
+SRC_FILES              := \
+                       myscoring.c
+CONF_FILE              := myscoring2.conf
+OBJ_FILES              := *.o
+
+# Build parameter
+
+all: clean build
+
+build:
+       $(CC) -fPIC -c $(SRC_FILES)
+       $(CC) -shared -o $(LIBRARY_FILE).$(LIBRARY_VER) $(OBJ_FILES) -lm
+       ln -sf $(LIBRARY_FILE).$(LIBRARY_VER) $(LIBRARY_FILE)
+       -rm -f $(OBJ_FILES)
+
+clean:
+       -rm -f $(OBJ_FILES)
+       -rm -f $(LIBRARY_FILE).$(LIBRARY_VER)
+       -rm -f $(LIBRARY_FILE)
+
+.PHONY: build clean
\ No newline at end of file
diff --git a/src/scoringmgr/mock/myscoring2/libmyscoring.so.1.0.1 b/src/scoringmgr/mock/myscoring2/libmyscoring.so.1.0.1
deleted file mode 100755 (executable)
index 582a2f0..0000000
Binary files a/src/scoringmgr/mock/myscoring2/libmyscoring.so.1.0.1 and /dev/null differ
index 50bdf3c88ecf8cc9fca06511c05c10bd9fe681f6..e20959da66d126693ef4d83e6056898697a9db33 120000 (symlink)
@@ -1 +1 @@
-libmyscoring.so.1.0.1
\ No newline at end of file
+libmyscoring2.so.1.0.1
\ No newline at end of file
diff --git a/src/scoringmgr/mock/myscoring2/libmyscoring2.so.1.0.1 b/src/scoringmgr/mock/myscoring2/libmyscoring2.so.1.0.1
new file mode 100755 (executable)
index 0000000..9b7ccbe
Binary files /dev/null and b/src/scoringmgr/mock/myscoring2/libmyscoring2.so.1.0.1 differ
old mode 100644 (file)
new mode 100755 (executable)
index 85ea3a9..0273fb9
@@ -1,6 +1,6 @@
 
 /*
-$ gcc -fPIC -c myscoring.c && gcc -shared -o -lm libmyscoring.so.1.0.1 myscoring.o -lm
+$ gcc -fPIC -c myscoring.c && gcc -shared -o libmyscoring.so.1.0.1 myscoring.o -lm
 $ ln -rs libmyscoring.so.1.0.1 libmyscoring.so
 */
 
@@ -84,3 +84,33 @@ double myscoring2(double (*getResource)(const char *))
 
   return score;
 }
+
+#define MY_SCORING_3_CNT 4
+double myscoring3(double (*getResource)(const char *))
+{
+
+  // printf("myscoring\n");
+
+  double score;
+  const char *resourceNames[MY_SCORING_3_CNT] = {"cpu/usage", "cpu/count", "memory/free", "memory/available"};
+  double W[MY_SCORING_3_CNT] = {1.48271, 4.125421, 5.3381723, 9.194717234};
+  double resourceValues[MY_SCORING_3_CNT];
+
+  // double someResource;
+  // someResource = getResource("some/usage");
+  // assert(isnan(someResource));
+
+  for (int i = 0; i < MY_SCORING_3_CNT; i++)
+  {
+    resourceValues[i] = getResource(resourceNames[i]);
+    // printf("resourceNames : %s %f\n", resourceNames[i], resourceValues[i]);
+  }
+
+  score = 0.0;
+  for (int i = 0; i < MY_SCORING_3_CNT; i++)
+  {
+    score += resourceValues[i] * W[i];
+  }
+
+  return score;
+}
old mode 100644 (file)
new mode 100755 (executable)
index abf934d..6ba9258
@@ -3,11 +3,11 @@
 ConfVersion=v0.0                                        ; Version of Configuration file
 
 [ServiceInfo]
-ServiceName=ll                              ; Name of distributed service
+ServiceName=org.tizen.chromium-efl                              ; Name of distributed service
 
 [ScoringMethod]
 LibFile=./libmyscoring.so                               ; Library file name
-FunctionName=myscoring2
+FunctionName=myscoring3
 
 [ResourceType]
 IntervalTimeMs=1000                                     ; Interval time of get resource
index 6c88452d3c099e39c64347a7ac12ad8d302751fb..df58266661bc23c4e0a67bc2ec85bf3480bfdbf1 100755 (executable)
@@ -18,6 +18,8 @@
 package servicemgr
 
 import (
+       "bufio"
+       "errors"
        "log"
        "os"
        "os/exec"
@@ -39,6 +41,7 @@ func (p Service) execute() (err error) {
 
        cmd, pid, err := p.setService()
        if err != nil {
+               log.Println(err)
                return
        }
        log.Println(logPrefix, "Just ran subprocess ", pid)
@@ -57,20 +60,50 @@ func (p Service) execute() (err error) {
 }
 
 func (p Service) setService() (cmd *exec.Cmd, pid int, err error) {
-       if len(p.paramStr) == 0 {
-               cmd = exec.Command(p.serviceName)
-       } else {
-               cmd = exec.Command(p.serviceName, p.paramStr...)
+       if len(p.paramStr) < 1 {
+               err = errors.New("error: empty parameter")
+               return
        }
+       cmd = exec.Command(p.paramStr[0], p.paramStr[1:]...)
+
+       // set "owner" account: need to execute user app
+       /*
+               execUser, _ := user.Lookup("owner")
+
+               uid, _ := strconv.Atoi(execUser.Uid)
+               gid, _ := strconv.Atoi(execUser.Gid)
+               groups, _ := execUser.GroupIds()
+
+               var gids = []uint32{}
+               for _, i := range groups {
+                       id, _ := strconv.Atoi(i)
+                       gids = append(gids, uint32(id))
+               }
+
+               log.Printf("uid(%d), gid(%d)", uid, gid)
+               log.Printf("groupIds: %v", gids)
 
-       cmd.Stdout = os.Stdout
+               cmd.SysProcAttr = &syscall.SysProcAttr{}
+               cmd.SysProcAttr.Credential = &syscall.Credential{
+                       Uid:    uint32(uid),
+                       Gid:    uint32(gid),
+                       Groups: gids,
+               }
+       */
 
+       stdout, _ := cmd.StdoutPipe()
        err = cmd.Start()
        if err != nil {
                log.Println(logPrefix, err.Error())
                return
        }
 
+       scanner := bufio.NewScanner(stdout)
+       for scanner.Scan() {
+               m := scanner.Text()
+               log.Println(m)
+       }
+
        pid = cmd.Process.Pid
 
        return
index 52c71f82bbebb9e19815939dc43cfc4dc884a105..3e2358f4ceaf1cf2d362d5c954ca820ab798dd2a 100755 (executable)
@@ -127,7 +127,7 @@ func checkError(err error) bool {
 
 func executeLocalEnv(appInfo map[string]interface{}) (err error) {
        //  check execution validation
-       _, err = exec.LookPath(appInfo[ConstKeyServiceName].(string))
+       _, err = exec.LookPath((appInfo[ConstKeyUserArgs].([]string))[0])
 
        if checkError(err) == false {
                go Run(appInfo)
index bd652eed6420b99cca226488bdf32ddffaf48404..b70ba36b8389724d299eb8a905de6260c22ddf47 100755 (executable)
@@ -32,6 +32,12 @@ const (
        serviceName2 = "main2"
 )
 
+var (
+       paramStr                = []string{"ls"}
+       paramStrWithArgs        = []string{"ls", "-ail"}
+       paramStrWithInvalidArgs = []string{"ls", "invalidArgs"}
+)
+
 var (
        targetLocalAddr, _ = common.GetOutboundIP()
        serviceID          uint64
@@ -45,7 +51,7 @@ func init() {
 func TestExecuteApp(t *testing.T) {
        notiChan := make(chan string)
 
-       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, nil, notiChan)
+       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, paramStr, notiChan)
        checkError(t, err)
 
        time.Sleep(time.Millisecond * 10)
@@ -54,8 +60,7 @@ func TestExecuteApp(t *testing.T) {
 func TestExecuteAppWithArgs(t *testing.T) {
        notiChan := make(chan string)
 
-       args := []string{"-ail"}
-       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, args, notiChan)
+       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, paramStrWithArgs, notiChan)
        checkError(t, err)
 
        select {
@@ -72,8 +77,7 @@ func TestExecuteAppWithArgs(t *testing.T) {
 func TestExecuteAppWithInvalidArgs(t *testing.T) {
        notiChan := make(chan string)
 
-       args := []string{"invalidArgs"}
-       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, args, notiChan)
+       _, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, paramStrWithInvalidArgs, notiChan)
        checkError(t, err)
 
        select {
@@ -90,7 +94,7 @@ func TestExecuteAppWithInvalidArgs(t *testing.T) {
 func TestHandleNoti(t *testing.T) {
        notiChan := make(chan string, 1)
 
-       id, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, nil, notiChan)
+       id, err := servicemgr.ExecuteApp(targetLocalAddr, serviceName, paramStr, notiChan)
        checkError(t, err)
 
        statusNotificationRequest := make(map[string]interface{})