{"id":812041,"url":"http://patchwork.ozlabs.org/api/patches/812041/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170910064713.31511-3-alison@peloton-tech.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170910064713.31511-3-alison@peloton-tech.com>","list_archive_url":null,"date":"2017-09-10T06:47:13","name":"[U-Boot,2/2] add pytests for 'gpt guid' command in sandbox","commit_ref":"a2f422555fc80144aea418c0d8e95341acfe6868","pull_url":null,"state":"accepted","archived":false,"hash":"7216d618f7a5dab45b646d41f0afe2a69d41dd51","submitter":{"id":69170,"url":"http://patchwork.ozlabs.org/api/people/69170/?format=json","name":"Alison Chaiken","email":"alison@peloton-tech.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170910064713.31511-3-alison@peloton-tech.com/mbox/","series":[{"id":2367,"url":"http://patchwork.ozlabs.org/api/series/2367/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=2367","date":"2017-09-10T06:47:11","name":"GPT: create block device for guid testing","version":1,"mbox":"http://patchwork.ozlabs.org/series/2367/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812041/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812041/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqhV334wcz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 16:48:43 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 24E84C21DC0; Sun, 10 Sep 2017 06:47:55 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5BA36C21DDF;\n\tSun, 10 Sep 2017 06:47:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid E9DCCC21E84; Sun, 10 Sep 2017 06:47:27 +0000 (UTC)","from bonnet.exerciseforthereader.org\n\t(173-228-89-192.dsl.static.fusionbroadband.com [173.228.89.192])\n\tby lists.denx.de (Postfix) with ESMTP id EC287C21E0C\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 06:47:21 +0000 (UTC)","by bonnet.exerciseforthereader.org (Postfix, from userid 1000)\n\tid B08735F78B; Sat,  9 Sep 2017 23:47:20 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"alison@peloton-tech.com","To":"u-boot@lists.denx.de","Date":"Sat,  9 Sep 2017 23:47:13 -0700","Message-Id":"<20170910064713.31511-3-alison@peloton-tech.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170910064713.31511-1-alison@peloton-tech.com>","References":"<CAPnjgZ2bha-k3m-1xb0FDUYEVuTk_tA-zve6WXHJhRVFSu3j9g@mail.gmail.com>\n\t<20170910064713.31511-1-alison@peloton-tech.com>","Cc":"alison@peloton-tech.com, alison@she-devel.com","Subject":"[U-Boot] [PATCH 2/2] add pytests for 'gpt guid' command in sandbox","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"From: Alison Chaiken <alison@peloton-tech.com>\n\nRun unit tests for the 'gpt guid' command, making use of the block\ndevice created by test/py/make_test_disk.py.  Remove this device at\nthe end of the tests.\n\nSigned-off-by: Alison Chaiken <alison@peloton-tech.com>\n---\n test/py/tests/test_gpt.py | 38 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 38 insertions(+)\n create mode 100644 test/py/tests/test_gpt.py","diff":"diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py\nnew file mode 100644\nindex 0000000000..73f5c50f6c\n--- /dev/null\n+++ b/test/py/tests/test_gpt.py\n@@ -0,0 +1,38 @@\n+# Copyright (c) 2017 Alison Chaiken\n+#\n+# SPDX-License-Identifier: GPL-2.0\n+\n+# Test GPT manipulation commands.\n+\n+import os\n+import pytest\n+import u_boot_utils\n+import make_test_disk\n+\n+\"\"\"\n+These tests rely on a 4 MB block device called testdisk.raw\n+which is automatically removed at the end of the tests.\n+\"\"\"\n+\n+@pytest.mark.buildconfigspec('cmd_gpt')\n+def test_gpt_guid(u_boot_console):\n+    \"\"\"Test the gpt guid command.\"\"\"\n+\n+    if u_boot_console.config.buildconfig.get('config_cmd_gpt', 'n') != 'y':\n+        pytest.skip('gpt command not supported')\n+    make_test_disk.makeDisk()\n+    u_boot_console.run_command('host bind 0 testdisk.raw')\n+    output = u_boot_console.run_command('gpt guid host 0')\n+    assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output\n+\n+@pytest.mark.buildconfigspec('cmd_gpt')\n+def test_gpt_save_guid(u_boot_console):\n+    \"\"\"Test the gpt guid command to save GUID into a string.\"\"\"\n+\n+    if u_boot_console.config.buildconfig.get('config_cmd_gpt', 'n') != 'y':\n+        pytest.skip('gpt command not supported')\n+    u_boot_console.run_command('host bind 0 testdisk.raw')\n+    output = u_boot_console.run_command('gpt guid host 0 newguid')\n+    output = u_boot_console.run_command('printenv newguid')\n+    assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output\n+    os.remove('testdisk.raw')\n","prefixes":["U-Boot","2/2"]}