Upgrade to v2.3
authorShao-Feng <shaofeng.tang@intel.com>
Wed, 6 Nov 2013 09:01:33 +0000 (17:01 +0800)
committerShao-Feng <shaofeng.tang@intel.com>
Wed, 6 Nov 2013 09:01:33 +0000 (17:01 +0800)
README [new file with mode: 0644]
README.md [deleted file]
makefile
packaging/testkit-stub.debug.spec
packaging/testkit-stub.spec
src/httpserver.cpp

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..55f985c
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+place holder
diff --git a/README.md b/README.md
deleted file mode 100644 (file)
index dccd626..0000000
--- a/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-TCT-stub
-========
-
-Intel Tizen Compatibility Test Stub
-
-to build and install x86 version on host pc,
-1, make
-
-2, sudo make install
-
-
-
-to build ARM version locally(without OBS), please make sure 
-
-1, install tizen2.0 SDK with all component selected, 
-
-2, replace all "/home/danny/" in build_data to your own home path, such as "/home/wl/"
-
-3, run native-make -t device in CommandLineBuild folder.
-
-
-to build unit test, just run "make ut" in root folder of the project. then run valgrind to check memory leak.
-
-valgrind --tool=memcheck --leak-check=yes --track-origins=yes -v ./ut
\ No newline at end of file
index 97e7be0b45b11224bbf53a89e5c244507f824b2c..08d5a3cac059baaab09b65846f7e7bdd34c1a4ab 100644 (file)
--- a/makefile
+++ b/makefile
@@ -65,10 +65,11 @@ clean:
        rm -f $(UT_TARGET)
 
 install: $(TARGET)
+       #cp $(TARGET) $(PREFIX_BIN)
        install -d $(DESTDIR)/usr/bin/
        install -m 755 $(TARGET) $(DESTDIR)/usr/bin/
        
 uninstall:
-       rm /usr/bin/$(TARGET)
+       rm -f $(PREFIX_BIN)/$(TARGET)
 
 rebuild: clean compile
index fa49a6fbacac894786bc277c1ca0ce5b1264e15d..59897cdaa89e6ead530d27c78fc60d1b2dcd94c4 100644 (file)
@@ -1,7 +1,7 @@
 
 Name:       testkit-stub
 Summary:    test
-Version:    1.0
+Version:    1.3
 Release:    1
 Group:      Development/Debug
 License:    GPL v2 only
index 6569f72a25b1672dab00c17c5ce7db257ddcd18e..9de331178ec38db695a9bb5b133cb8770bb7ca42 100644 (file)
@@ -1,7 +1,7 @@
 
 Name:       testkit-stub
 Summary:    test
-Version:    1.0
+Version:    1.3
 Release:    1
 Group:      Development/Debug
 License:    GPL v2 only
index 7bca8b6b28cdc3a1e3f2612c31027af4ce7cb477..544202a8543974a49aa8697d4b0793eba0f2de2d 100644 (file)
@@ -243,7 +243,7 @@ a typical workflow of manual case would be
 **/
 void HttpServer::processpost(int s, struct HttpRequest *prequest) {
        prequest->prefix = "application/json";
-       string json_str = "{\"OK\":1}";
+       string json_str = "";
 
        if (prequest->path.find("/init_test") != string::npos) {// invoke by com-module to init some para for test
                Json::Reader reader;
@@ -274,13 +274,15 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                                //wait for the index window.close, otherwise will occur bind aleady error
                                sleep(1);
                        }
+
+                       json_str = "{\"OK\":1}";
                }
                else {
                        cout << "error while parse para from com-module, can't start test" << endl;
                        cout << prequest->content;
                        DBG_ONLY(outputFile << "error while parse para from com-module, can't start test" << endl;);
                        DBG_ONLY(outputFile << prequest->content;);
-                       json_str = "{\"Error\":\"parse error\"}";
+                       json_str = "{\"Error\":1}";
                }
        } else if (prequest->path.find("/set_testcase") != string::npos) {// invoke by com-module to send testcase data
                m_block_finished = false;
@@ -299,6 +301,8 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                m_block_case_index = 0;
                if (m_current_block_index == 1)
                        m_total_case_index = 0;
+
+               json_str = "{\"OK\":1}";
        } else if (prequest->path == "/check_server") {// invoke by index.html to find server running or not
                m_server_checked = true;
                m_check_times = 0;
@@ -306,6 +310,7 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                
                cout << "[ checking server, and found the server is running ]" << endl;
                DBG_ONLY(outputFile << "[ checking server, and found the server is running ]" << endl;);
+               json_str = "{\"OK\":1}";
        } else if (prequest->path == "/check_server_status") {// invoke by com-module to get server status
                Json::Value status;
                status["block_finished"] = m_block_finished ? 1 : 0;
@@ -332,8 +337,10 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
        } else if (prequest->path == "/shut_down_server") {
                if (g_run_wiget == true)
                        killAllWidget(); // kill all widget when shutdown server
+               json_str = "{\"OK\":1}";
                gIsRun = 0;
        } else if (prequest->path.find("/init_session_id") != string::npos) {// invoke by index.html to record a session id
+               json_str = "{\"OK\":1}";
                int index = prequest->path.find('=');
                if (index != -1) {
                        m_running_session = prequest->path.substr(index + 1);
@@ -359,7 +366,7 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                        string error_type = "";
                        bool find_tc = get_auto_case(prequest->content, &error_type);
                        if (find_tc == false) {
-                               json_str = "{\"" + error_type + "\":0}";
+                               json_str = "{\"" + error_type + "\":1}";// {none:0} will not work sometime
                        } else {
                                json_str = m_test_cases[m_block_case_index].to_json().toStyledString();
                        }
@@ -401,6 +408,7 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                        json_str = "{\"Error\":\"no manual result\"}";
                } else {
                        find_purpose(splitContent(prequest->content), false); // will set index in find_purpose
+                       json_str = "{\"OK\":1}";
                }
        } else if (prequest->path.find("/check_execution_progress") != string::npos) {//invoke by index.html to get test result of last auto case
                char *total_count = new char[16];
@@ -422,6 +430,8 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                m_block_finished = true;
                if (m_current_block_index == m_totalBlocks)
                        m_set_finished = true;
+
+               json_str = "{\"OK\":1}";
        }
        //from com module,when m_set_finished is true
        else if (prequest->path == "/get_test_result") {
@@ -460,12 +470,16 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
                    }
 
                    find_purpose(paras, true);
+
+                   json_str = "{\"OK\":1}";
             }
         }
     } else if (prequest->path == "/set_capability") {// by com-module to send capability data
         Json::Reader reader;
 
         reader.parse(prequest->content, m_capability);
+
+        json_str = "{\"OK\":1}";
     } else if (prequest->path.find("/capability") != string::npos) {// by test suite. only one query parameter each time
         json_str = "{\"support\":0}";
 
@@ -488,7 +502,6 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) {
         }
        } else {
         cout << "=================unknown request: " << prequest->path << endl;
-               json_str = "{\"Error\":\"unknown request\"}";
        }
     
     DBG_ONLY(
@@ -718,8 +731,8 @@ void HttpServer::StartUp() {
                return;
        }
        gIsRun = 1;
-       cout << "[ Server is running.....]" << endl;
-       DBG_ONLY(outputFile << "[ Server is running.....]" << endl;);
+       cout << "[Server is running.....]" << endl;
+       DBG_ONLY(outputFile << "[Server is running.....]" << endl;);
 
        while (gIsRun) {
                clientsocket = accept(serversocket, (struct sockaddr *) &clientAddr,