{"id":809180,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809180/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1504397939-12847-2-git-send-email-alison@peloton-tech.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/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":"<1504397939-12847-2-git-send-email-alison@peloton-tech.com>","list_archive_url":null,"date":"2017-09-03T00:18:58","name":"[U-Boot,2/3] add pytest for 'gpt guid' command in sandbox","commit_ref":null,"pull_url":null,"state":"deferred","archived":false,"hash":"17ece1f40f16a17eb8355a814fe3f38fa3e2cdb5","submitter":{"id":69170,"url":"http://patchwork.ozlabs.org/api/1.2/people/69170/?format=json","name":"Alison Chaiken","email":"alison@peloton-tech.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.2/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1504397939-12847-2-git-send-email-alison@peloton-tech.com/mbox/","series":[{"id":1186,"url":"http://patchwork.ozlabs.org/api/1.2/series/1186/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=1186","date":"2017-09-03T00:18:57","name":"[U-Boot,1/3] GPT: create block device for sandbox testing","version":1,"mbox":"http://patchwork.ozlabs.org/series/1186/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809180/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809180/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 3xlDCZ1V5Tz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  3 Sep 2017 10:20:42 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid DB102C21FAB; Sun,  3 Sep 2017 00:19:31 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 708A7C21F03;\n\tSun,  3 Sep 2017 00:19:18 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 9FA4FC21EDF; Sun,  3 Sep 2017 00:19:15 +0000 (UTC)","from alison-debian.peloton-tech.com (unknown [12.1.72.210])\n\tby lists.denx.de (Postfix) with SMTP id C68E0C21C59\n\tfor <u-boot@lists.denx.de>; Sun,  3 Sep 2017 00:19:14 +0000 (UTC)","(qmail 12901 invoked by uid 1026); 3 Sep 2017 00:19:13 -0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"*","X-Spam-Status":"No, score=1.3 required=5.0 tests=RDNS_NONE autolearn=no\n\tautolearn_force=no version=3.4.0","From":"alison@peloton-tech.com","To":"u-boot@lists.denx.de","Date":"Sat,  2 Sep 2017 17:18:58 -0700","Message-Id":"<1504397939-12847-2-git-send-email-alison@peloton-tech.com>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1504397939-12847-1-git-send-email-alison@peloton-tech.com>","References":"<1504397939-12847-1-git-send-email-alison@peloton-tech.com>","Cc":"alison@she-devel.com, trini@konsulko.com, alison@peloton-tech.com","Subject":"[U-Boot] [PATCH 2/3] add pytest 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 disk.raw\nblock device created by test/gpt/make-test-disk.sh script.  Remove\nthis device at the end of the tests.\n\nSigned-off-by: Alison Chaiken <alison@peloton-tech.com>\n---\n test/py/tests/test_gpt.py | 39 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 39 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 0000000..2201f39\n--- /dev/null\n+++ b/test/py/tests/test_gpt.py\n@@ -0,0 +1,39 @@\n+# Copyright (c) 2017 Alison Chaiken\n+#\n+# SPDX-License-Identifier: GPL-2.0\n+\n+# Test GPT manipulation commands.\n+# Before executing the test, please run the test/gpt/make-test-disk.sh script.\n+\n+import os\n+import pytest\n+import u_boot_utils\n+\n+\"\"\"\n+These tests rely on a 256KB block device called disk.raw.  Run\n+    test/gpt/make-test-disk.sh\n+in order to create this device, which is automatically removed at the end of the\n+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+    u_boot_console.run_command('host bind 0 disk.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 disk.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('disk.raw')\n","prefixes":["U-Boot","2/3"]}