1# 使用说明 2 3## 测试代码说明 4> 本套测试代码,提供了3个用例 5 6<table> 7<thead> 8<tr> 9<th width="10%">标题</th> 10<th width="15%">用例名称</th> 11<th width="35%">测试步骤</th> 12<th width="40%">预期结果</th> 13</tr> 14</thead> 15<tbody> 16<tr> 17<td>用例1</td> 18<td>接口基本功能测试</td> 19<td>按默认条件编译出一个版本,刷机上电运行,检查日志</td> 20<td>用例全部通过。并检查是否可搜到关键字:this is the first run of test after flash</td> 21</tr> 22<tr> 23<td>用例2</td> 24<td>数据重启可用测试</td> 25<td>用例1执行完后,重启设备,检查日志</td> 26<td>用例全部通过。并检查是否可搜到关键字:this is not the first run of test after flash</td> 27</tr> 28<tr> 29<td>用例3</td> 30<td>token持久化测试</td> 31<td>打开 TOKEN_PERSIST_TEST 宏(去注释BUILD.gn里面第37行defines)进行编译,重新刷机上电运行,检查日志</td> 32<td>用例全部通过。并检查是否可搜到关键字:this is the first run of test after flash</td> 33</tr> 34</tbody> 35</table> 36 37 38## 编译说明 39 40### 第一步 41打开当前路径BUILD.gn,修改第33行为oem_auth_config.h和oem_auth_result_storage.h 实际所在路径。 42默认为:`"//vendor/kitframework/include/"`,asr、bl等芯片平台适用。 43Hi3861芯片平台可能需要修改为:`"//vendor/hisilicon/hi3861/hals/utils/token/include"` 44 45### 第二步 46修改 `test/xts/acts/build_lite/BUILD.gn` 中 **liteos_m** 部分的代码,去掉 ActsKitFwkApiTest 所在行的注释,将其他目标都注释掉,排除测试干扰,最终大概是这样的: 47``` 48 if (ohos_kernel_type == "liteos_m") { 49 all_features += [ 50 # "//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest", 51 # "//test/xts/acts/communication_lite/softbus_hal:ActsSoftBusTest", 52 # "//test/xts/acts/communication_lite/wifiservice_hal:ActsWifiServiceTest", 53 # "//test/xts/acts/utils_lite/file_hal:ActsUtilsFileTest", 54 # "//test/xts/acts/startup_lite/syspara_hal:ActsParameterTest", 55 # "//test/xts/acts/iothardware_lite/peripheral_hal:ActsWifiIotTest", 56 # "//test/xts/acts/kernel_lite/kernelcmsis_hal:ActsCMSISTest", 57 # "//test/xts/acts/utils_lite/kv_store_hal:ActsKvStoreTest", 58 # "//test/xts/acts/security_lite/huks_hal:ActsSecurityDataTest", 59 # "//test/xts/acts/hiviewdfx_lite/hilog_hal:ActsDfxFuncTest", 60 # "//test/xts/acts/distributed_schedule_lite/system_ability_manager_hal:ActsSamgrTest", 61 # "//test/xts/acts/update_lite/dupdate_hal:ActsUpdaterFuncTest", 62 # "//test/xts/acts/startup_lite/bootstrap_hal:ActsBootstrapTest", 63 "//test/xts/acts/applications/kitframework:ActsKitFwkApiTest", 64 ] 65``` 66 67### 第三步 68按常规XTS测试的执行方式,修改当前芯片平台的链接方式,确保 **ActsKitFwkApiTest** 这个静态库会链接进最终刷机镜像里。这一步,不同芯片平台方法不同。 69如果是Hi3861,默认工程配置已添加所有XTS lib库,无需额外配置。 70如果是asr平台,需修改device/asr/asr582x/BUILD.gn:搜索`asr582x_xts_enable`,在`ldflags`里面增加一行: `"-lmodule_ActsKitFwkApiTest"` 71 72### 第四步 73请确保下面的修改已合入当前工程: 74[https://gitee.com/openharmony/xts_tools/commit/b41caca330471816a18ac24a49f955ad761b2e23](https://gitee.com/openharmony/xts_tools/commit/b41caca330471816a18ac24a49f955ad761b2e23) 75[https://gitee.com/openharmony/xts_tools/commit/9b3ecb0c6f2605151bd1fe22a4a8e57b67c6e17b](https://gitee.com/openharmony/xts_tools/commit/9b3ecb0c6f2605151bd1fe22a4a8e57b67c6e17b) 76 77### 第五步 78编译,刷机,运行看日志