本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
本節說明如何檢視和解譯 IDT 結果報告與日誌。
若要對錯誤進行故障診斷,請參閱 IDT for AWS IoT Greengrass V2 故障診斷。
檢視結果
執行期間,IDT 會將錯誤寫入主控台、日誌檔和測試報告。IDT 完成資格測試套件後會產生兩份測試報告。這些報告位於 中
。兩個報告都會擷取執行資格測試套件的結果。<device-tester-extract-location>
/results/<execution-id>
/
awsiotdevicetester_report.xml
是您提交給 AWS 以在 Device AWS Partner Catalog 中列出裝置的資格測試報告。該報告包含下列元素:
-
IDT 版本。
-
已測試的 AWS IoT Greengrass 版本。
-
device.json
檔案中指定的 SKU 和裝置集區名稱。 -
device.json
檔案中指定的裝置集區的功能。 -
測試結果的彙總摘要。
-
根據裝置功能進行測試的程式庫測試結果明細,例如本機資源存取、陰影和 MQTT。
GGV2Q_Result.xml
報告採用 JUnit XML 格式
-
測試結果的彙總摘要。
-
已測試 AWS IoT Greengrass 功能對測試結果進行分解。
解譯 AWS IoT Device Tester 結果
awsiotdevicetester_report.xml
或 awsiotdevicetester_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 服務互通。如果您想要在 Device AWS Partner Catalog 中列出您的裝置,您可以使用此報告做為資格證據。
如果測試發生失敗或錯誤,您可以檢閱 <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>
資料夾。