From adba07cb9090206b6a673df4ce6af179b2a0d4a3 Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 17 Feb 2022 14:28:37 +0800 Subject: [PATCH 01/15] modified the words Signed-off-by: stivn --- aw/cxx/distributed/distributed.h | 12 ++++++------ aw/cxx/distributed/distributed_agent.cpp | 10 +++++----- aw/cxx/distributed/distributed_cfg.h | 2 +- aw/cxx/distributed/distributed_major.cpp | 12 ++++++------ aw/cxx/hwext/perf.h | 2 +- examples/calculator/include/calculator.h | 4 +++- examples/calculator/src/calculator.cpp | 1 - .../fuzztest/common/parse_fuzzer/parse_fuzzer.cpp | 4 ++-- .../test/fuzztest/common/parse_fuzzer/parse_fuzzer.h | 10 ++++------ examples/detector/include/detector.h | 4 ++++ examples/sleep/include/sleep_ex.h | 7 ++++--- examples/sleep/src/sleep_ex.cpp | 6 +++--- 12 files changed, 39 insertions(+), 35 deletions(-) diff --git a/aw/cxx/distributed/distributed.h b/aw/cxx/distributed/distributed.h index 9e4d3b0..857e263 100644 --- a/aw/cxx/distributed/distributed.h +++ b/aw/cxx/distributed/distributed.h @@ -21,12 +21,12 @@ namespace OHOS { namespace DistributeSystemTest { -static const int MAX_BUFF_LEN = 1024; -static const int DST_COMMAND_NOTIFY = 0; -static const int DST_COMMAND_CALL = 1; -static const int DST_COMMAND_MSG = 2; -static const int DST_COMMAND_END = 3; -static const int DEFAULT_AGENT_PORT = 6789; +constexpr int MAX_BUFF_LEN = 1024; +constexpr int DST_COMMAND_NOTIFY = 0; +constexpr int DST_COMMAND_CALL = 1; +constexpr int DST_COMMAND_MSG = 2; +constexpr int DST_COMMAND_END = 3; +constexpr int DEFAULT_AGENT_PORT = 6789; struct DistributedCmd { int no; // record command no, as return no. diff --git a/aw/cxx/distributed/distributed_agent.cpp b/aw/cxx/distributed/distributed_agent.cpp index 400847e..fc1d7af 100644 --- a/aw/cxx/distributed/distributed_agent.cpp +++ b/aw/cxx/distributed/distributed_agent.cpp @@ -94,7 +94,7 @@ int DistributedAgent::InitAgentServer() } addr.sin_port = htons(agentPort_); - int err = ::bind(serverSockFd, (struct sockaddr *)&addr, sizeof(addr)); + int err = ::bind(serverSockFd, reinterpret_cast(&addr), sizeof(addr)); if (err < 0) { HiLog::Error(DistributedAgent::LABEL, "agent bind error.\n"); close(serverSockFd); @@ -132,7 +132,7 @@ int DistributedAgent::DoCmdServer(int serverSockFd) while (receiveLen > 0) { HiLog::Info(DistributedAgent::LABEL, "wait client .......\n"); - if ((clientSockFd = accept(serverSockFd, (struct sockaddr *)&clientAddr, &sinSize)) > 0) { + if ((clientSockFd = accept(serverSockFd, reinterpret_cast(&clientAddr), &sinSize)) > 0) { break; } receiveLen--; @@ -153,9 +153,9 @@ int DistributedAgent::DoCmdServer(int serverSockFd) return -1; } // every cmd length less than MAX_BUFF_LEN bytes; - int cmdLen = recv(clientSockFd_, buff, DST_COMMAND_HEAD_LEN, 0); - if (static_cast(cmdLen) < DST_COMMAND_HEAD_LEN) { - if (cmdLen == 0) { + int recvCmdLen = recv(clientSockFd_, buff, DST_COMMAND_HEAD_LEN, 0); + if (static_cast(recvCmdLen) < DST_COMMAND_HEAD_LEN) { + if (recvCmdLen == 0) { HiLog::Info(DistributedAgent::LABEL, "agent connect socket closed, IP:%s .\n", inet_ntoa(clientAddr.sin_addr)); mbStop_ = true; diff --git a/aw/cxx/distributed/distributed_cfg.h b/aw/cxx/distributed/distributed_cfg.h index 1c6a6ab..e8fb0a1 100644 --- a/aw/cxx/distributed/distributed_cfg.h +++ b/aw/cxx/distributed/distributed_cfg.h @@ -41,7 +41,7 @@ public: ~DistributedCfg(); bool OpenCfg(std::string fileName); bool GetCfgVal(std::string key, std::string &value); - std::string GetValueInString(std::string str, size_t devNO); + std::string GetValueInString(std::string str, size_t devNo); std::string GetDeviceIp(std::string fileName, size_t devNo); std::string GetDeviceUuid(std::string fileName, size_t devNo); static std::unique_ptr& GetInstance(); diff --git a/aw/cxx/distributed/distributed_major.cpp b/aw/cxx/distributed/distributed_major.cpp index 1638b82..771aec9 100644 --- a/aw/cxx/distributed/distributed_major.cpp +++ b/aw/cxx/distributed/distributed_major.cpp @@ -130,7 +130,7 @@ int DistributeTestEnvironment::ConnectAgent(size_t devNo) addr.sin_port = htons(serverPort_); int connectCount = 0; for (connectCount = 0; connectCount < CONNECT_TIME; connectCount++) { // try connect to agent 3 times. - if (connect(clientSockFd, (struct sockaddr *)&addr, sizeof(addr)) == 0) { + if (connect(clientSockFd, reinterpret(&addr), sizeof(addr)) == 0) { break; } std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); // delay 10ms @@ -184,11 +184,11 @@ bool DistributeTestEnvironment::SendToAgent(size_t devNo, int cmdType, void *pst } globalCommandNo++; char szrbuf[MAX_BUFF_LEN] = {0}; - auto pCmdTest = reinterpret_cast(pstrMsg); - pCmdTest->no = globalCommandNo; - pCmdTest->cmdTestType = htons(cmdType); - pCmdTest->len = htons(len); - int rlen = send(clientList_[devNo].fd, pCmdTest, static_cast(len + DST_COMMAND_HEAD_LEN), 0); + auto pCmdMsg = reinterpret_cast(pstrMsg); + pCmdMsg->no = globalCommandNo; + pCmdMsg->cmdTestType = htons(cmdType); + pCmdMsg->len = htons(len); + int rlen = send(clientList_[devNo].fd, pCmdMsg, static_cast(len + DST_COMMAND_HEAD_LEN), 0); if (rlen <= 0) { HiLog::Error(LABEL, "agent socket is closed."); return breturn; diff --git a/aw/cxx/hwext/perf.h b/aw/cxx/hwext/perf.h index 662dd91..9cc894c 100644 --- a/aw/cxx/hwext/perf.h +++ b/aw/cxx/hwext/perf.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "securec.h" #include diff --git a/examples/calculator/include/calculator.h b/examples/calculator/include/calculator.h index 9b8168f..4f39f2f 100644 --- a/examples/calculator/include/calculator.h +++ b/examples/calculator/include/calculator.h @@ -12,10 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#ifndef _EXAMPLE_CALCULATOR_H_ +#define _EXAMPLE_CALCULATOR_H_ int Add(int e1, int e2); int Sub(int e1, int e2); int Mul(int e1, int e2); int Div(int e1, int e2); +#endif // _EXAMPLE_CALCULATOR_H_ \ No newline at end of file diff --git a/examples/calculator/src/calculator.cpp b/examples/calculator/src/calculator.cpp index e71a031..63cd5de 100644 --- a/examples/calculator/src/calculator.cpp +++ b/examples/calculator/src/calculator.cpp @@ -13,7 +13,6 @@ * limitations under the License. */ -#include int Add(int e1, int e2) { diff --git a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp index 576457a..93dba7d 100644 --- a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp +++ b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp @@ -15,8 +15,8 @@ #include "parse_fuzzer.h" -#include -#include +#include +#include const int FUZZ_DATA_LEN = 3; const int FUZZ_FST_DATA = 0; diff --git a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h index bf3acfc..a0e1c8c 100644 --- a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h +++ b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h @@ -13,11 +13,9 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include +#ifndef _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_ +#define _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_ #define FUZZ_PROJECT_NAME "parse_fuzzer" + +#endif // _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_ diff --git a/examples/detector/include/detector.h b/examples/detector/include/detector.h index 26d0a1b..a4c0327 100644 --- a/examples/detector/include/detector.h +++ b/examples/detector/include/detector.h @@ -13,7 +13,11 @@ * limitations under the License. */ +#ifndef _EXAMPLE_DETECTOR_H_ +#define _EXAMPLE_DETECTOR_H_ #include bool IsPrime(int n); bool FileExist(const char* fileName); + +#endif // _EXAMPLE_DETECTOR_H_ \ No newline at end of file diff --git a/examples/sleep/include/sleep_ex.h b/examples/sleep/include/sleep_ex.h index d6ca5b3..9fabe59 100644 --- a/examples/sleep/include/sleep_ex.h +++ b/examples/sleep/include/sleep_ex.h @@ -13,10 +13,11 @@ * limitations under the License. */ -#include -#include -#include +#ifndef _EXAMPLE_SLEEP_H_ +#define _EXAMPLE_SLEEP_H_ typedef void (*time_callback)(void *); int Msleep(unsigned long milisec); double ElapsedTime(time_callback func, void* arg); + +#endif // _EXAMPLE_SLEEP_H_ \ No newline at end of file diff --git a/examples/sleep/src/sleep_ex.cpp b/examples/sleep/src/sleep_ex.cpp index 5c21328..c441959 100644 --- a/examples/sleep/src/sleep_ex.cpp +++ b/examples/sleep/src/sleep_ex.cpp @@ -32,8 +32,8 @@ static double TimeDiff(struct timeval *x , struct timeval *y) return 0; } - double xUs = (double)x->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL + (double)x->tv_usec; - double yUs = (double)y->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL + (double)y->tv_usec; + double xUs = reinterpret_cast(x->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + reinterpret_cast(x->tv_usec); + double yUs = reinterpret_cast(y->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + reinterpret_cast(y->tv_usec); return (yUs - xUs); } @@ -52,7 +52,7 @@ int Msleep(unsigned long miliSec) { struct timespec req = {0, 0}; struct timespec rem = {0, 0}; - time_t sec = (int)(miliSec / SleepTest::ID_SE_TO_MS_LEVEL); + time_t sec = reinterpret_cast(miliSec / SleepTest::ID_SE_TO_MS_LEVEL); miliSec = miliSec - (sec * SleepTest::ID_SE_TO_MS_LEVEL); req.tv_sec = sec; req.tv_nsec = miliSec * SleepTest::ID_MS_TO_NS_LEVEL; -- Gitee From bc6f554f0683176da10873c79ef26d8aac9403ee Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 17 Feb 2022 15:52:02 +0800 Subject: [PATCH 02/15] modified Signed-off-by: stivn --- .../test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp | 2 -- examples/sleep/include/sleep_ex.h | 6 +++--- examples/sleep/src/sleep_ex.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp index 93dba7d..e09b54e 100644 --- a/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp +++ b/examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp @@ -13,8 +13,6 @@ * limitations under the License. */ -#include "parse_fuzzer.h" - #include #include diff --git a/examples/sleep/include/sleep_ex.h b/examples/sleep/include/sleep_ex.h index 9fabe59..0b7939d 100644 --- a/examples/sleep/include/sleep_ex.h +++ b/examples/sleep/include/sleep_ex.h @@ -13,11 +13,11 @@ * limitations under the License. */ -#ifndef _EXAMPLE_SLEEP_H_ -#define _EXAMPLE_SLEEP_H_ +#ifndef EXAMPLE_SLEEP_H_ +#define EXAMPLE_SLEEP_H_ typedef void (*time_callback)(void *); int Msleep(unsigned long milisec); double ElapsedTime(time_callback func, void* arg); -#endif // _EXAMPLE_SLEEP_H_ \ No newline at end of file +#endif // EXAMPLE_SLEEP_H_ \ No newline at end of file diff --git a/examples/sleep/src/sleep_ex.cpp b/examples/sleep/src/sleep_ex.cpp index c441959..46444f1 100644 --- a/examples/sleep/src/sleep_ex.cpp +++ b/examples/sleep/src/sleep_ex.cpp @@ -32,8 +32,10 @@ static double TimeDiff(struct timeval *x , struct timeval *y) return 0; } - double xUs = reinterpret_cast(x->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + reinterpret_cast(x->tv_usec); - double yUs = reinterpret_cast(y->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + reinterpret_cast(y->tv_usec); + double xUs = reinterpret_cast(x->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + + reinterpret_cast(x->tv_usec); + double yUs = reinterpret_cast(y->tv_sec * SleepTest::ID_MS_TO_NS_LEVEL) + + reinterpret_cast(y->tv_usec); return (yUs - xUs); } -- Gitee From 4c7e28637024070dc30977ad1284e2874e339fa5 Mon Sep 17 00:00:00 2001 From: stivn Date: Fri, 18 Feb 2022 11:04:40 +0800 Subject: [PATCH 03/15] modified the code Signed-off-by: stivn --- src/core/config/config_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/config/config_manager.py b/src/core/config/config_manager.py index c8224e0..3b463f6 100755 --- a/src/core/config/config_manager.py +++ b/src/core/config/config_manager.py @@ -92,7 +92,7 @@ class FilterConfigManager(object): if child.tag != target_name: continue for child2 in child: - if child2.tag != product_form.lower(): + if child2.tag.lower() != product_form.lower(): continue for child3 in child2: if child3.text != "" and child3.text is not None: -- Gitee From 216d727e0ccfa1bce03861500853ff3f2d67bde4 Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 10 Mar 2022 09:25:35 +0800 Subject: [PATCH 04/15] save new file --- aaa.txt | 0 bbb.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 aaa.txt create mode 100644 bbb.txt diff --git a/aaa.txt b/aaa.txt new file mode 100644 index 0000000..e69de29 diff --git a/bbb.txt b/bbb.txt new file mode 100644 index 0000000..e69de29 -- Gitee From b99c954f1293d6a0d7e9aff795ded2bb3eacece6 Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 10 Mar 2022 09:29:24 +0800 Subject: [PATCH 05/15] New change --- bbb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/bbb.txt b/bbb.txt index e69de29..2f9bdb0 100644 --- a/bbb.txt +++ b/bbb.txt @@ -0,0 +1 @@ +qwewqewqewq -- Gitee From c42722cdb3137f062e6dccea20ac0c9036b99218 Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 10 Mar 2022 09:44:01 +0800 Subject: [PATCH 06/15] hotfix branch --- ccc.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ccc.txt diff --git a/ccc.txt b/ccc.txt new file mode 100644 index 0000000..e69de29 -- Gitee From ddedfdabeb2dd79f5ed5c6ddcb60f095550a418f Mon Sep 17 00:00:00 2001 From: stivn Date: Thu, 10 Mar 2022 09:49:41 +0800 Subject: [PATCH 07/15] xs new file --- ddd.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ddd.txt diff --git a/ddd.txt b/ddd.txt new file mode 100644 index 0000000..e69de29 -- Gitee From 35ef27daab4664199344dd81270a1471eccf394c Mon Sep 17 00:00:00 2001 From: stivn Date: Mon, 14 Mar 2022 16:45:30 +0800 Subject: [PATCH 08/15] test --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index d3fecc0..a22721a 100755 --- a/README.md +++ b/README.md @@ -1,13 +1,4 @@ -# Developers Test - -- [Overview](#section7375710115617) -- [Directory Structure](#section102031353175317) -- [Constraints](#section87444710110) -- [Installation](#section1347156474) -- [Using Test Framework](#section75882026185016) -- [Test Result and Log](#section414715805819) -- [Repositories Involved](#section6299103515474) - +# Developers Test ## Overview This module allows you to develop new test cases for new features, or modify existing test cases for modified features. The developers test framework helps you develop high-quality code. -- Gitee From 271e0c5180397b8d8c9db6406bb0254ff735d399 Mon Sep 17 00:00:00 2001 From: stivn Date: Mon, 14 Mar 2022 16:55:08 +0800 Subject: [PATCH 09/15] test1 --- third_party/lib/cpp/BUILD.gn | 9 --------- 1 file changed, 9 deletions(-) diff --git a/third_party/lib/cpp/BUILD.gn b/third_party/lib/cpp/BUILD.gn index 8898794..99c0b3e 100755 --- a/third_party/lib/cpp/BUILD.gn +++ b/third_party/lib/cpp/BUILD.gn @@ -11,15 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -config("gtest_private_config") { - visibility = [ ":*" ] - include_dirs = [ "//third_party/googletest/googletest" ] -} - -config("gtest_config") { - include_dirs = [ "//third_party/googletest/googletest/include" ] -} - static_library("gtest") { #testonly = true public = [ -- Gitee From 8f74e16a2f433c451f850269f6f702e60efd147d Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:39:07 +0000 Subject: [PATCH 10/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20cc?= =?UTF-8?q?c.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ccc.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ccc.txt diff --git a/ccc.txt b/ccc.txt deleted file mode 100644 index e69de29..0000000 -- Gitee From bb86f1743a68571735c63fa3c46cf0bbd63f3949 Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:39:18 +0000 Subject: [PATCH 11/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20aa?= =?UTF-8?q?a.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aaa.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 aaa.txt diff --git a/aaa.txt b/aaa.txt deleted file mode 100644 index e69de29..0000000 -- Gitee From 50fd762b7c079af852fc7a7e5ee9486a9c499925 Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:39:31 +0000 Subject: [PATCH 12/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20RE?= =?UTF-8?q?ADME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 354 ------------------------------------------------------ 1 file changed, 354 deletions(-) delete mode 100755 README.md diff --git a/README.md b/README.md deleted file mode 100755 index a22721a..0000000 --- a/README.md +++ /dev/null @@ -1,354 +0,0 @@ -# Developers Test -## Overview - -This module allows you to develop new test cases for new features, or modify existing test cases for modified features. The developers test framework helps you develop high-quality code. - -## Directory Structure - -``` -developertest/ -├── aw # Static libraries of the test framework -│ ├── cxx # C++ libraries -│ └── python # Python libraries -├── config # Test framework configuration -│ ├── build_config.xml # Test case build configuration -│ ├── filter_config.xml # Test case filter configuration -│ ├── framework_config.xml # Test type configuration -│ └── user_config.xml # User configuration -├── examples # Test case examples -│ ├── calculator # Calculator -│ └── test # Test resources -├── src # Source code of the test framework -│ ├── main # Entry function -│ └── core # Core code of the test framework -├── third_party # Adaptation code for third-party components on which the test framework relies -│ └── lib # Compilation configuration of the static library -├── BUILD.gn # Compilation entry of the test framework -├── start.bat # Developers test entry for Windows -└── start.sh # Developers test entry for Linux -``` - -## Constraints - -The test tool environment must meet the following requirements: - -1. Python version: 3.7.5 or later -2. Paramiko version: 2.7.1 or later -3. Setuptools version: 40.8.0 or later -4. RSA version: 4.0 or later -5. NFS version: V4 or later \(required when device supports connection using the serial port but not the hdc\) -6. pySerial version: 3.3 or later \(required when the device supports connection using the serial port but not the hdc\) -7. OS version: Windows 10 or later; Ubuntu 18.04 - -## Installation - -The Python environment is required. - -1. Run the following command to install the Linux extension component Readline: - - ``` - sudo apt-get install libreadline-dev - ``` - - ``` - Reading package lists... Done - Building dependency tree - Reading state information... Done - libreadline-dev is already the newest version (7.0-3). - 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. - ``` - -2. Run the following command to install the plug-in Setuptools: - - ``` - pip3 install setuptools - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Requirement already satisfied: setuptools in d:\programs\python37\lib\site-packages (41.2.0) - ``` - -3. Run the following command to install the plug-in Paramiko: - - ``` - pip3 install paramiko - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Installing collected packages: pycparser, cffi, pynacl, bcrypt, cryptography, paramiko - Successfully installed bcrypt-3.2.0 cffi-1.14.4 cryptography-3.3.1 paramiko-2.7.2 pycparser-2.20 pynacl-1.4.0 - ``` - -4. Run the following command to install the Python plug-in RSA: - - ``` - pip3 install rsa - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Installing collected packages: pyasn1, rsa - Successfully installed pyasn1-0.4.8 rsa-4.7 - ``` - -5. Run the following command to install the serial port plug-in pySerial for Python on the local PC: - - ``` - pip3 install pyserial - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Requirement already satisfied: pyserial in d:\programs\python37\lib\site-packages\pyserial-3.4-py3.7.egg (3.4) - ``` - -6. If the device supports test result output only using the serial port, install the NFS server. - - For example, to install haneWIN NFS Server 1.2.50 for Windows, download the installation package from https://www.hanewin.net/nfs-e.htm. - - For Linux, run the following command: - - ``` - sudo apt install nfs-kernel-server - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Reading package lists... Done - Building dependency tree - Reading state information... Done - nfs-kernel-server is already the newest version (1:1.3.4-2.1ubuntu5.3). - 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. - ``` - - -## Using Test Framework - -- \(Optional\) Install the XDevice module. - 1. Go to the XDevice installation directory **test/xdevice**. - 2. Open the console and run the following command: - - ``` - python setup.py install - ``` - - If the installation is successful, the following prompts are displayed: - - ``` - Installed d:\programs\python37\lib\site-packages\xdevice-0.0.0-py3.7.egg - Processing dependencies for xdevice==0.0.0 - Finished processing dependencies for xdevice==0.0.0 - ``` - - -- Configure the developers test module in the configuration file **developertest/config/user\_config.xml**. - 1. Modify basic configuration parameters of the test framework. - - \[build\] \# Configure build parameters of the test case. - - ``` - - false - false - true - ... - - ``` - - >![](public_sys-resources/icon-note.gif) **NOTE:** - >**example**: whether to build the test case example. The default value is **false**. - >**version**: whether to build the test version. The default value is **false**. - >**testcase**: whether to build the test case. The default value is **true**. - - 2. For devices that support the Harmony device connector \(hdc\), modify the configuration file as follows: - - \[device\] \# Configure the device information with the **"usb-hdc"** attribute, including the test device IP address and the matched hdc port. - - ``` - - 192.168.1.1 - 9111 - - - ``` - - 3. For devices that only support the serial port connection, modify the configuration file as follows: - - \[device\] \# Configure the serial port information with the **"ipcamera"** attribute, including the COM port and baud rate. - - ``` - - - COM1 - cmd - 115200 - 8 - 1 - 1 - - - ``` - - -- \(Optional\) Modify the configuration file **config/user\_config.xml** of the **developertest** module. If a test case has been compiled, specify the compilation output directory of the test case. In this case, the test platform will not recompile the test case. - 1. Specify the output directory of the test case, that is, the compilation output directory between the **** tags. - - ``` - - /home/opencode/out/release/tests - - ``` - - 2. For devices that only support serial port connection, specify the NFS directory on the PC \(**host\_dir**\) and the corresponding directory on the board \(**board\_dir**\) between the **** tags. For example: - - ``` - - D:\nfs - user - - ``` - - -- Prepare the test environment. \(Check that the test environment is ready if the tested device only supports serial port connection.\) - - The system image and file system have been burnt into a development board and are running properly on the development board. For example, in system mode, device prompt **OHOS\#** is displayed during shell login, indicating that the system is running properly. - - The development host has been connected to the serial port of the development board and the network port. - - The IP addresses of the development host and development board are in the same network segment and can ping each other. - - An empty directory is created on the development host for mounting test cases through the NFS, and the NFS service is started properly. - -- Run test suites. - - Start the test framework and go to the **test/developertest** directory. - 1. Run the following command to start the test framework in Windows. - - ``` - start.bat - ``` - - 2. Run the following command to start the test framework in Linux. - - ``` - ./strat.sh - ``` - - - - Select a device form. - - Configure device forms based on the actual development board, for example, **developertest/config/framework\_config.xml**. - - - Run test commands. - 1. To query the subsystems, modules, product forms, and test types supported by test cases, run the **show** commands. - - ``` - usage: - show productlist Querying Supported Product Forms - show typelist Querying the Supported Test Type - show subsystemlist Querying Supported Subsystems - show modulelist Querying Supported Modules - ``` - - 2. Run the execution command, where **-t** is mandatory, and **-ss** and **-tm** are optional. - - ``` - run -t ut -ss test -tm example - ``` - - 3. Specify the parameters that can be used to execute the test suite corresponding to a specific feature or module. - - ``` - usage: run [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]] - [-ss SUBSYSTEM] [-tm TESTMODULE] [-ts TESTSUIT] - [-tc TESTCASE] [-tl TESTLEVEL] - - optional arguments: - -h, --help show this help message and exit - -p PRODUCTFORM, --productform PRODUCTFORM Specified product form - -t [TESTTYPE [TESTTYPE ...]], --testtype [TESTTYPE [TESTTYPE ...]] - Specify test type(UT,MST,ST,PERF,ALL) - -ss SUBSYSTEM, --subsystem SUBSYSTEM Specify test subsystem - -tm TESTMODULE, --testmodule TESTMODULE Specified test module - -ts TESTSUIT, --testsuite TESTSUIT Specify test suite - -tc TESTCASE, --testcase TESTCASE Specify test case - -tl TESTLEVEL, --testlevel TESTLEVEL Specify test level - ``` - - - -- See the test framework help if needed. - - Run the following command to query commands supported by the test platform: - - ``` - help - ``` - - - -- Exit the self-test platform. - - Run the following command to exit the test platform: - - ``` - quit - ``` - - - -## Test Result and Log - -- Test logs and test reports are generated after you execute the test commands. -- Test result - - Reports are displayed on the console. The root path of the test result is as follows: - - ``` - reports/xxxx-xx-xx-xx-xx-xx - ``` - - - Test case formatting result - - ``` - result/ - ``` - - - Test case log - - ``` - log/plan_log_xxxx-xx-xx-xx-xx-xx.log - ``` - - - Report summary - - ``` - summary_report.html - ``` - - - Test report details - - ``` - details_report.html - ``` - - -- Test framework log - - ``` - reports/platform_log_xxxx-xx-xx-xx-xx-xx.log - ``` - -- Latest test reports - - ``` - reports/latest - ``` - - -## Repositories Involved - -[testing subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/testing-subsystem.md) - -**test\_developertest** - -[test\_xdevice](https://gitee.com/openharmony/test_xdevice/blob/master/README.md) -- Gitee From 862e274c0ae87b1efd1afbff61d764d9382edb74 Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:40:06 +0000 Subject: [PATCH 13/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20bb?= =?UTF-8?q?b.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbb.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 bbb.txt diff --git a/bbb.txt b/bbb.txt deleted file mode 100644 index 2f9bdb0..0000000 --- a/bbb.txt +++ /dev/null @@ -1 +0,0 @@ -qwewqewqewq -- Gitee From d6c6cdd52e2c6d6e319d9700842844d18e4a9a13 Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:40:12 +0000 Subject: [PATCH 14/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20dd?= =?UTF-8?q?d.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ddd.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ddd.txt diff --git a/ddd.txt b/ddd.txt deleted file mode 100644 index e69de29..0000000 -- Gitee From d1c3c66aeb7128d8f085de659b10f8a680bfbbf5 Mon Sep 17 00:00:00 2001 From: stivn <9699603+stivn@user.noreply.gitee.com> Date: Tue, 15 Mar 2022 06:40:40 +0000 Subject: [PATCH 15/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20th?= =?UTF-8?q?ird=5Fparty/lib/cpp/BUILD.gn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/lib/cpp/BUILD.gn | 75 ------------------------------------ 1 file changed, 75 deletions(-) delete mode 100755 third_party/lib/cpp/BUILD.gn diff --git a/third_party/lib/cpp/BUILD.gn b/third_party/lib/cpp/BUILD.gn deleted file mode 100755 index 99c0b3e..0000000 --- a/third_party/lib/cpp/BUILD.gn +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (c) 2020 Huawei Device Co., Ltd. -# 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. - -static_library("gtest") { - #testonly = true - public = [ - "//third_party/googletest/googletest/include/gtest/gtest.h", - "//third_party/googletest/googletest/include/gtest/gtest-spi.h", - ] - sources = [ - "//third_party/googletest/googletest/include/gtest/gtest-death-test.h", - "//third_party/googletest/googletest/include/gtest/gtest-message.h", - "//third_party/googletest/googletest/include/gtest/gtest-param-test.h", - "//third_party/googletest/googletest/include/gtest/gtest-printers.h", - "//third_party/googletest/googletest/include/gtest/gtest-test-part.h", - "//third_party/googletest/googletest/include/gtest/gtest-typed-test.h", - "//third_party/googletest/googletest/include/gtest/gtest_pred_impl.h", - "//third_party/googletest/googletest/include/gtest/gtest_prod.h", - "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h", - "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h", - "//third_party/googletest/googletest/include/gtest/internal/custom/gtest.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-internal.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-port.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-string.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h", - "//third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h", - "//third_party/googletest/googletest/include/gtest/hwext/gtest-ext.h", - "//third_party/googletest/googletest/include/gtest/hwext/gtest-filter.h", - "//third_party/googletest/googletest/include/gtest/hwext/gtest-tag.h", - "//third_party/googletest/googletest/include/gtest/hwext/utils.h", - "//third_party/googletest/googletest/src/gtest-death-test.cc", - "//third_party/googletest/googletest/src/gtest-filepath.cc", - "//third_party/googletest/googletest/src/gtest-internal-inl.h", - "//third_party/googletest/googletest/src/gtest-port.cc", - "//third_party/googletest/googletest/src/gtest-printers.cc", - "//third_party/googletest/googletest/src/gtest-test-part.cc", - "//third_party/googletest/googletest/src/gtest-typed-test.cc", - "//third_party/googletest/googletest/src/gtest.cc", - "//third_party/googletest/googletest/src/hwext/gtest-ext.cc", - "//third_party/googletest/googletest/src/hwext/gtest-filter.cc", - "//third_party/googletest/googletest/src/hwext/gtest-tag.cc", - "//third_party/googletest/googletest/src/hwext/gtest-utils.cc", - ] - public_configs = [ ":gtest_config" ] - configs += [ ":gtest_private_config" ] - defines = [ "GTEST_HAS_CLONE=0" ] -} - -static_library("gtest_main") { - #testonly = true - sources = [ - "//third_party/googletest/googletest/src/gtest_main.cc", - ] - public_deps = [ - ":gtest", - ] -} - - -- Gitee