test: py: tests: test_gpt.py: add a simple test for the command gpt repair
authorPhilippe Reynes <philippe.reynes@softathome.com>
Fri, 22 Apr 2022 15:46:50 +0000 (17:46 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 6 May 2022 18:39:15 +0000 (14:39 -0400)
Adds a simple test for the command gpt repair.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
test/py/tests/test_gpt.py

index 229d7eb..f707d9f 100644 (file)
@@ -101,6 +101,16 @@ def test_gpt_verify(state_disk_image, u_boot_console):
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_gpt')
 @pytest.mark.requiredtool('sgdisk')
+def test_gpt_repair(state_disk_image, u_boot_console):
+    """Test the gpt repair command."""
+
+    u_boot_console.run_command('host bind 0 ' + state_disk_image.path)
+    output = u_boot_console.run_command('gpt repair host 0')
+    assert 'Repairing GPT: success!' in output
+
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.requiredtool('sgdisk')
 def test_gpt_guid(state_disk_image, u_boot_console):
     """Test the gpt guid command."""