了解結果和日誌 - AWS IoT Greengrass

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

了解結果和日誌

本節說明如何檢視和解譯 IDT 結果報告與日誌。

若要疑難排解錯誤,請參閱疑難排解 IDTAWS IoT GreengrassV2

檢視結果

執行期間,IDT 會將錯誤寫入主控台、日誌檔和測試報告。IDT 完成資格測試套件後會產生兩份測試報告。這些報告位於中<device-tester-extract-location>/results/<execution-id>/。這兩個報告都會擷取執行資格測試套件的結果。

awsiotdevicetester_report.xml是您提交的資格測試報告,以AWS便在設備目錄中列出您的AWS Partner設備。該報告包含下列元素:

  • IDT 版本。

  • 經過測試的 AWS IoT Greengrass 版本。

  • device.json 檔案中指定的 SKU 和裝置集區名稱。

  • device.json 檔案中指定的裝置集區的功能。

  • 測試結果的彙總摘要。

  • 根據設備功能(例如本地資源訪問,陰影和 MQTT)進行測試的庫進行測試的測試結果明細。

GGV2Q_Result.xml 報告採用 JUnit XML 格式。您可以將它整合到持續整合和部署平台,例如 JenkinsBamboo 等。該報告包含下列元素:

  • 測試結果的彙總摘要。

  • 依測試的 AWS IoT Greengrass 功能將測試結果分類。

解譯AWS IoT Device Tester結果

awsiotdevicetester_report.xmlawsiotdevicetester_report.xml 的報告區段會列出已執行的測試及結果。

第一個 XML 標籤<testsuites>包含測試運行的摘要。例如:

<testsuites name="GGQ results" time="2299" tests="28" failures="0" errors="0" disabled="0">
<testsuites> 標籤中使用的屬性
name

測試套件的名稱。

time

執行資格套件所花費的時間 (以秒為單位)。

tests

執行的測試數目。

failures

已執行但未通過的測試次數。

errors

IDT 無法運行的測試數量。

disabled

忽略此屬性。不會使用。

awsiotdevicetester_report.xml 檔案包含 <awsproduct> 標籤,其中包含關於受測產品和經過一系列測試驗證後之產品功能的資訊。

<awsproduct> 標籤中使用的屬性
name

受測產品名稱。

version

受測產品版本。

features

驗證的功能。標記為 required 的功能為提交主機板獲得資格時所需。以下片段顯示此資訊如何出現在 awsiotdevicetester_report.xml 檔案中。

<name="aws-iot-greengrass-v2-core" value="supported" type="required"></feature>

如果所需功能沒有測試失敗或錯誤,您的裝置即符合執行 AWS IoT Greengrass 的技術要求,可與 AWS IoT 服務相互運作。如果您想要在裝置目錄中列出AWS Partner裝置,您可以使用此報告作為資格證據。

如果測試發生失敗或錯誤,您可以檢閱 <testsuites> XML 標籤來識別失敗的測試。<testsuites> 標籤內的 <testsuite> XML 標籤會顯示測試群組的測試結果摘要。例如:

<testsuite name="combination" package="" tests="1" failures="0" time="161" disabled="0" errors="0" skipped="0">

其格式類似於 <testsuites> 標籤,但有不使用且可忽略的 skipped 屬性。在每個<testsuite> XML 標<testcase>籤中,針對測試群組執行的每個測試都有標籤。例如:

<testcase classname="Security Combination (IPD + DCM) Test Context" name="Security Combination IP Change Tests sec4_test_1: Should rotate server cert when IPD disabled and following changes are made:Add CIS conn info and Add another CIS conn info" attempts="1"></testcase>>
<testcase> 標籤中使用的屬性
name

測試的名稱。

attempts

IDT 執行測試案例的次數。

當測試案例失敗或發生錯誤時,系統就會將 <failure><error> 標籤新增至 <testcase> 標籤,其中附有相關資訊以利故障診斷。例如:

<testcase classname="mcu.Full_MQTT" name="AFQP_MQTT_Connect_HappyCase" attempts="1"> <failure type="Failure">Reason for the test failure</failure> <error>Reason for the test execution error</error> </testcase>

檢視 日誌

IDT 從中的測試運行生成日誌<devicetester-extract-location>/results/<execution-id>/logs。該工具會產生兩組日誌:

test_manager.log

從的測試管理員元件產生的記錄檔AWS IoT Device Tester (例如,與組態、測試順序和報告產生相關的記錄檔)。

<test-case-id>.log (for example, lambdaDeploymentTest.log)

測試組中測試用例的日誌,包括來自被測設備的日誌。從 IDT v4.2.0 開始,IDT 將每個測試用例的測試日誌分組在<devicetester-extract-location>/results/<execution-id>/logs/<test-group-id>/目錄中的單獨 <test-case-id > 文件夾中。