[Pkg-libvirt-commits] [libguestfs] 193/233: actions/part_set_gpt_type: set type of "guid" parameter as "GUID" (RHBZ#1008417).

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:12:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit a948389ce9c76bf7e8997bb27f3daac06cb20c50
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Mon Feb 10 11:00:09 2014 +0100

    actions/part_set_gpt_type: set type of "guid" parameter as "GUID" (RHBZ#1008417).
    
    Switch the type of the "guid" parameter from "String" to "GUID"; this
    adds the validation of the GUID as such, rejecting straight away invalid
    GUIDs which otherwise could be handled badly by low-level tools (such as
    sgdisk).
    
    Add a couple of easy tests (taken from RHBZ#1008417) to
    part_set_gpt_type about this.
---
 generator/actions.ml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/generator/actions.ml b/generator/actions.ml
index b665149..a6ef194 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -11339,9 +11339,18 @@ group with GUID C<diskgroup>." };
 
   { defaults with
     name = "part_set_gpt_type";
-    style = RErr, [Device "device"; Int "partnum"; String "guid"], [];
+    style = RErr, [Device "device"; Int "partnum"; GUID "guid"], [];
     proc_nr = Some 392;
     optional = Some "gdisk";
+    tests = [
+      InitGPT, Always, TestLastFail (
+        [["part_set_gpt_type"; "/dev/sda"; "1"; "f"]]), [];
+      InitGPT, Always, TestResultString (
+        [["part_set_gpt_type"; "/dev/sda"; "1";
+          "01234567-89AB-CDEF-0123-456789ABCDEF"];
+         ["part_get_gpt_type"; "/dev/sda"; "1"]],
+        "01234567-89AB-CDEF-0123-456789ABCDEF"), [];
+    ];
     shortdesc = "set the type GUID of a GPT partition";
     longdesc = "\
 Set the type GUID of numbered GPT partition C<partnum> to C<guid>. Return an

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list