支援終止通知:2026 年 10 月 7 日 AWS 將停止 的支援 AWS IoT Greengrass Version 1。2026 年 10 月 7 日之後,您將無法再存取 AWS IoT Greengrass V1 資源。如需詳細資訊,請造訪從 遷移 AWS IoT Greengrass Version 1。
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
執行 AWS IoT Greengrass 資格套件
在您設定必要組態之後,便可開始測試。完整測試套件的執行時間取決於您的硬體。做為參考,在 Raspberry Pi 3B 上完成整個測試套件約需 30 分鐘。
下列範例 run-suite 命令示範如何執行裝置集區的資格測試。裝置集區是一組相同的裝置。
- IDT v3.0.0 and later
-
- 執行指定的測試套件中的所有測試群組。
-
devicetester_[linux | mac | win_x86-64] run-suite --suite-id GGQ_1.0.0 --pool-id <pool-id>
使用 list-suites 命令列出 tests 資料夾中的測試套件。
- 執行測試套件中的特定測試群組。
-
devicetester_[linux | mac | win_x86-64] run-suite --suite-id GGQ_1.0.0 --group-id <group-id> --pool-id <pool-id>
使用 list-groups 命令列出測試套件中的測試群組。
- 執行測試群組中的特定測試案例。
-
devicetester_[linux | mac | win_x86-64] run-suite --group-id <group-id> --test-id <test-id>
- 執行測試群組中的多個測試案例。
-
devicetester_[linux | mac | win_x86-64] run-suite --group-id <group-id> --test-id <test-id1>,<test-id2>
- 列出測試群組中的測試案例。
-
devicetester_[linux | mac | win_x86-64] list-test-cases --group-id <group-id>
run-suite 命令的選項是選擇性的。例如,如果 device.json 檔案中只定義一個裝置集區,則可以省略 pool-id。或者,如果您想要執行 tests 資料夾中最新的測試套件版本,則可以省略 suite-id。
如果線上有較新的測試套件版本,IDT 會提示您。如需詳細資訊,請參閱設定預設更新行為。
如需 run-suite 和其他 IDT 命令的詳細資訊,請參閱 IDT for AWS IoT Greengrass 命令。
- IDT v2.3.0 and earlier
-
- 執行指定套件中的所有測試群組。
-
devicetester_[linux | mac | win_x86-64] run-suite --suite-id GGQ_1 --pool-id <pool-id>
- 執行特定的測試群組。
-
devicetester_[linux | mac | win_x86-64] run-suite --suite-id GGQ_1 --group-id <group-id> --pool-id <pool-id>
如果您在單一裝置集區上執行單一測試套件,則 suite-id 和 pool-id 是選擇性的。這表示您的 device.json 檔案中只定義了一個裝置集區。
檢查 Greengrass 相依性
我們建議您在執行相關測試群組之前,先執行相依性檢查程式測試群組,以確定所有 Greengrass 相依性都已安裝。例如:
-
在執行核心資格測試組之前執行 ggcdependencies。
-
在執行容器特定測試群組之前執行 containerdependencies。
-
在執行 Docker 特定測試群組之前執行 dockerdependencies。
-
在執行串流管理員特定測試群組之前執行 ggcstreammanagementdependencies。
設定預設更新行為
當您開始測試回合時,IDT 會在線上檢查是否有較新的測試套件版本。如果有新版本,IDT 會提示您更新至最新的可用版本。您可以設定 upgrade-test-suite (或 u) 旗標來控制預設的更新行為。有效的 值如下:
如果您未包含 upgrade-test-suite 旗標,IDT 會在有可用的更新時提示您,並等待 30 秒供您輸入 (y 或 n)。如果未輸入項目,它會預設為 n 並繼續執行測試。
下列範例顯示此功能的常用案例:
- 自動使用測試群組可用的最新測試。
-
devicetester_linux run-suite -u y --group-id mqtt --pool-id DevicePool1
- 在特定測試套件版本中執行測試。
-
devicetester_linux run-suite -u n --suite-id GGQ_1.0.0 --group-id mqtt --pool-id DevicePool1
- 在執行時間提示更新。
-
devicetester_linux run-suite --pool-id DevicePool1
IDT for AWS IoT Greengrass 命令
IDT 命令位於 <device-tester-extract-location>/bin 目錄中。將它們用於下列操作:
- IDT v3.0.0 and later
-
help
-
列出所指定命令的相關資訊。
list-groups
-
列出指定測試套件中的群組。
list-suites
-
列出可用的測試套件。
list-supported-products
-
列出支援的 產品,在此案例中為 AWS IoT Greengrass IDT 版本,以及測試套件版本。
list-test-cases
-
列出特定測試群組中的測試案例。支援下列選項:
run-suite
-
在裝置集區上執行測試套件。以下是一些支援的選項:
-
suite-id。 要執行的測試套件版本。如果未指定,IDT 會使用 tests 資料夾中的最新版本。
-
group-id。 要執行的測試群組,以逗號分隔的清單。如果未指定,IDT 會執行測試套件中的所有測試群組。
-
test-id。 要執行的測試案例,以逗號分隔的清單。指定時,group-id 必須指定單一群組。
-
pool-id。 要測試的裝置集區。如果 device.json 檔案中已定義多個裝置集區,則必須指定集區。
-
upgrade-test-suite。 控制測試套件版本更新的處理方式。從 IDT v3.0.0 開始,IDT 會在線上檢查是否有更新的測試套件版本。如需詳細資訊,請參閱測試套件版本。
-
stop-on-first-failure。 設定 IDT 在第一次失敗時停止執行。此選項應與 group-id 搭配使用以偵錯指定的測試群組。執行完整測試套件產生資格報告時,請勿使用此選項。
-
update-idt。 設定提示更新 IDT 的回應。Y當 輸入在 IDT 偵測到有較新的版本時停止測試執行。N當輸入繼續測試執行時。
-
update-managed-policy。輸入 Y 會在 IDT 偵測到使用者的受管政策未更新時停止測試執行。輸入 N 則繼續測試執行。
如需 run-suite 選項的詳細資訊,請使用下列 help 選項:
devicetester_[linux | mac | win_x86-64] run-suite -h
- IDT v2.3.0 and earlier
-
help
-
列出所指定命令的相關資訊。
list-groups
-
列出指定測試套件中的群組。
list-suites
-
列出可用的測試套件。
run-suite
-
在裝置集區上執行測試套件。
如需 run-suite 選項的詳細資訊,請使用下列 help 選項:
devicetester_[linux | mac | win_x86-64] run-suite -h