 Hello everyone, my name is Qiu Tingting. I'm working for FNST's agile team in China. This is our company. It's beautiful. Okay, today my topic is how to create a test suite with P1 agile for new agile service. First, I will introduce agile agile application framework and agile service. Then I will introduce agile P1 agile and how to create a test suite for a new agile service. And last, I will introduce how to run the test suite by P1 agile and how to debug for the new agile service. Now, let's see the application framework in agile. What is the application framework in agile? Look at this picture. There are four layers in agile. From top to bottom is application. It's application framework, system services and OS. The application framework is this part, provides the components to install and uninstall applications and to run them. And it contains agile service, application framework bundle and others. Maybe you want to know what is the agile service? There are many services. So let's see this picture. The application possess agile service by works. And agile service provides specific works for various functions. Works are implemented through the API provided by the APP framework bundle. There are already some services in agile. For example, agile service, Bluetooth, agile service, AVC and other services. On the other hand, you could create your agile service unnecessarily. In agile service, bonding is important. It defines the corresponding relationship between agile service and verbs. Let's look at the definition of bonding. Here and later, I will take agile service as an example. It is a demo service. In bonding, we could use this way to define your service and verbs like this. First, the service. Here, service name is defined and verbs is here. Which verbs is used? You can see verbs defined. Definition. Ping is the verb name here. Ping sample is the correct function. And other settings. If you want to create a new service, you can refer to the following link or other service. Where could we find the test suite of agile service? Previce agile. Each agile service has a repository like this. And the test sets are distributed in each repository. Like this. Agile service, Bluetooth test is here. Agile service, agile service, AVC test is here. Test sets are distributed in different places. So each test set needs to be set separately during testing. Without unified scheduling is difficult. Can it be integrated? It's a problem. And we could use the pure agile to solve the problem. What is the pure agile? Pure agile was written to be used as a testing framework replacing the Lula FB test web. However, the modules are written in a way that could be used as standalone utilities. To query and invalidation APIs and verbs from the application framework boundary services in agile. Now let's see the features of pure agile. It supports integrated test. It has debug module. Mode provides selecting test item. It supports remote test. The test script language is passing. If you want to know other details, please see this URL about pure agile menu. In agile, pure agile is as the rule of application. Look this picture. In its framework, it has tests and services. Look at this. In tests, we have test masservice.pua file. In service, we have masservice.pua file. And notice that there is another pytest.ini file here. You could find the existed pure agile source code in the following repository. Let's see the calling relationship of them. First, pure agile access agile services by web socket is important. Then in pure agile, test masservice.pua file provides test cases. Take test subscript as an example. And masservice.pua file provides subscript method to access verbs of agile service masservice. Notice that agile service masservice method subscript name is method in subscript. This method is subscript 2. This is pua agile service. This is agile service. Be careful. Now let's write these files. Step 1. You should create service of pua agile which named masservice.pua under services directory. At the beginning, you should import some basic packages like this. Then you should define my service class as the pua service. This part is my service class. In this class, you should define the methods of accessing agile service. There are two methods here. Subscribe and get time. Subscribe and unsubscribe methods are special. Because all the agile service have subscript and unsubscribe verbs, you can use its parents class subscript and unsubscribe methods, which is defined in the best.pua file. Like this. You should create test set of pua agile which named testmytestservice.pua under test directory. At the beginning, you should import some basic packages too. Like this part. And import the pua agile service named masservice. This one. Then you should assign marks for this test set. It is for all the test cases in this file. Like this. Of course, you could set a mark for one case. Then you should init the object of pua agile service. This part is init last. You could write your test cases one by one. Like this. This is one test case whose name begins with test on the run. Step third. You should add your new mark into pua test.init file. Like this. This is the mark name. This is the description about the mark. We have prepared the test set. So how do you run it? You should prepare environment before run test. Such as compare your agile service for your board. Compare details can be found from this menu. Then install your agile service in your board and start it. This is the command. Then you should select the way to run the test. There are two ways to run test. Look and remote. In the look way, you must log in board first. Then you could run a single test case by this command. pua agile and your test set file and test case name is a result. You could run a single test set by this command. pua agile and your test set file. This is the test result. You also could run the test with custom mark when you set the m parameter. Like this. This command. pua agile and m and mark name. This is the result. You could run all test sets without any parameter. Like this. Just pua agile. It's a part of the result. How about a remote way? In remote way, you could test the board from one PC. But your only wrong test set for one board on one time. For example, first time you can run test on ArcGin3. And second time you can run test on this board or other board. Before run test set, you must export the agile target rp environment block. You should add pass for pua agile. Look. Run a single test case. It's the pua agile command. pua agile test set file and test case name. This is the result. It's run a single test set pua agile and pua agile set file. Test set file. It's a result. Run the test set with custom mark. It's pua agile and parameter. Mark name and pua agile directory. It's necessary. It's a result. If you want to run all the test set. You should use pua agile and set pua agile directory. It's a result. If your team have many developers, one pua agile environment maybe is not enough. This is our team's solution. We use Docker containers to support multi pua agile environment in multi pua agile environment. All pua agile environments can access or test the boards. You could view the test results according to the test log. Like this. Case file. Dot. Dot means case passed. If you want to know the test case name. You could add three parameters to queue to the test set. Then you can view more details from log. It's an example. We can see the test set file name and the test case name. Fail case. Refer to the polling relationship of pua agile. There are three types of error. For the test masservice.py error may be from test set. For masservice.py error may be from pua agile service. For agile service masservice error may be from agile services. Example. Error from test set. In test set there are two error examples. One is assertion condition error. Look at this. Look at this. Log details. It's easy. We know. Assertion condition. Head problem. Another is parameter error. It's easy to know it's error. So it's the error from the test set. Let's see another case. Add point one. This part. Assertion function is correct. Add point two. According to the log. It's determined that the error is related to the parameter. Because our parameter is event. Point three. This part. The event parameter is correct. Final. We can confirm that it is not a test set case error. So we check the pua agile service file. In pua agile masservice.py file. We found that there is a parameter like this. So it is the error from pua agile service. Let's see the search case. According to the point one. It's okay. There is no problem. And according to point two. It's determined that the error is related to the parameter. And according to the point three. The parameter is correct. So confirm that it is not a test case error. Then we check the pua agile service file. See this part from source code. The event parameter is correct too. So it is not the agile service. We check the code about agile service. In agile service masservice.c file. In subscript method. Look at this part about the logic and error. So it is the error from agile service. That's all the debug method. Hope the bug contents can be helpful to your work. That's all. Thank you.