1# Setting Up the Environment 2 3## Basic Test Framework Environment 4 5|Environment|Operating System|Linux Extended Component|Python|Python Plug-ins|NFS Server|HDC| 6|------------|------------|------------|------------|------------|------------|------------| 7|Version|Ubuntu 18.04 or later|libreadline-dev|3.7.5 or later|- pySerial 3.3 or later<br>- Paramiko 2.7.1 or later<br>- Setuptools 40.8.0 or later<br>- rsa4.0 or later|haneWIN NFS Server 1.2.50 or later, or NFS v4 or later| 1.1.0 or later| 8|Description|Provides code build environment.|Plug-in used to read commands.|Language used by the test framework.|- pySerial: supports Python serial port communication. <br>- Paramiko: allows Python to use SSH. <br>- Setuptools: allows Python packages to be created and distributed easily. <br>- rsa: implements RSA encryption in Python.|Enables devices to be connected through the serial port.| A tool that enables devices to be connected through the HarmonyOS Device Connector (HDC).| 9 10## Installation Process 111. Run the following command to install the Linux extended component libreadline: 12 ``` 13 sudo apt-get install libreadline-dev 14 ``` 15 The installation is successful if the following information is displayed: 16 ``` 17 Reading package lists... Done 18 Building dependency tree 19 Reading state information... Done 20 libreadline-dev is already the newest version (7.0-3). 21 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. 22 ``` 232. Run the following command to install the Setuptools plug-in: 24 ``` 25 pip3 install setuptools 26 ``` 27 The installation is successful if the following information is displayed: 28 ``` 29 Requirement already satisfied: setuptools in d:\programs\python37\lib\site-packages (41.2.0) 30 ``` 313. Run the following command to install the Paramiko plug-in: 32 ``` 33 pip3 install paramiko 34 ``` 35 The installation is successful if the following information is displayed: 36 ``` 37 Installing collected packages: pycparser, cffi, pynacl, bcrypt, cryptography, paramiko 38 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 39 ``` 404. Run the following command to install the ras plug-in: 41 ``` 42 pip3 install rsa 43 ``` 44 The installation is successful if the following information is displayed: 45 ``` 46 Installing collected packages: pyasn1, rsa 47 Successfully installed pyasn1-0.4.8 rsa-4.7 48 ``` 495. Run the following command to install the pySerial plug-in: 50 ``` 51 pip3 install pyserial 52 ``` 53 The installation is successful if the following information is displayed: 54 ``` 55 Requirement already satisfied: pyserial in d:\programs\python37\lib\site-packages\pyserial-3.4-py3.7.egg (3.4) 56 ``` 576. Install the NFS server if the device outputs results only through the serial port. 58 - In Windows, install, for example, haneWIN NFS Server 1.2.50. 59 - In Linux, run the following command to install the NFS server: 60 ``` 61 sudo apt install nfs-kernel-server 62 ``` 63 The installation is successful if the following information is displayed: 64 ``` 65 Reading package lists... Done 66 Building dependency tree 67 Reading state information... Done 68 nfs-kernel-server is already the newest version (1:1.3.4-2.1ubuntu5.3). 69 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. 70 ``` 717. Install the HDC tool if the device supports HDC connections. For details about the installation process, see: 72 73 https://gitee.com/openharmony/developtools_hdc_standard/blob/master/README.md 74 75## Checking the Environment 76 77| Check Item|Operation|Requirements| 78| --- | --- | --- | 79| Check whether Python is installed successfully.|Run the **python --version** command.|The Python version is 3.7.5 or later.| 80| Check whether Python plug-ins are successfully installed.|Go to the **test/developertest** directory and run **start.bat** or **start.sh**.| The **>>>** prompt is displayed.| 81|Check the NFS server status (for the devices that support only serial port output).|Log in to the development board through the serial port and run the **mount** command to mount the NFS.|The file directory can be mounted.| 82|Check whether the HDC tool is successfully installed.|Run the **hdc_std -v** command.|The HDC version is 1.1.0 or later.| 83