From 3ddab9d7360213cda421ac25f62cbf7ef92b513b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 19 Oct 2017 18:00:33 +0300 Subject: Add support for machine_manifest changes value --- bbot/agent/agent.cxx | 3 ++- bbot/machine-manifest.cxx | 10 ++++++++++ bbot/machine-manifest.hxx | 7 +++++-- unit-tests/machine-manifest/testscript | 15 +++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index dac70ee..ea0bb34 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -311,7 +311,8 @@ try mh.summary, machine_type::kvm, string ("de:ad:be:ef:de:ad"), - nullopt}, + nullopt, + strings ()}, toolchain_manifest {tc_id}, bootstrap_manifest {} }); diff --git a/bbot/machine-manifest.cxx b/bbot/machine-manifest.cxx index be921d9..b30d551 100644 --- a/bbot/machine-manifest.cxx +++ b/bbot/machine-manifest.cxx @@ -144,6 +144,13 @@ namespace bbot options = move (op); } + else if (n == "changes") + { + if (v.empty ()) + bad_value ("empty machine changes"); + + changes.emplace_back (move (v)); + } else if (!iu) bad_name ("unknown name '" + n + "' in machine manifest"); } @@ -187,6 +194,9 @@ namespace bbot s.next ("options", v); } + for (const string& c: changes) + s.next ("changes", c); + s.next ("", ""); // End of manifest. } diff --git a/bbot/machine-manifest.hxx b/bbot/machine-manifest.hxx index efcdda4..47dd7ac 100644 --- a/bbot/machine-manifest.hxx +++ b/bbot/machine-manifest.hxx @@ -36,6 +36,7 @@ namespace bbot machine_type type; optional mac; // Required in bootstrapped machine manifest. optional options; // Note: could be quoted. + strings changes; strings unquoted_options () const; // Return empty if absent. @@ -45,13 +46,15 @@ namespace bbot std::string s, machine_type t, optional m, - optional o) + optional o, + strings c) : machine_header_manifest (std::move (i), std::move (n), std::move (s)), type (t), mac (std::move (m)), - options (std::move (o)) {} + options (std::move (o)), + changes (std::move (c)) {} public: machine_manifest () = default; // VC export. diff --git a/unit-tests/machine-manifest/testscript b/unit-tests/machine-manifest/testscript index e264b41..7506796 100644 --- a/unit-tests/machine-manifest/testscript +++ b/unit-tests/machine-manifest/testscript @@ -20,6 +20,11 @@ type: kvm mac: de:ad:be:ef:de:ad options: -device "virtio-scsi-pci,id=scsi" -device "scsi-hd,drive=disk0" + changes: \ + 0.7.0 + - mac is changed to de:ad:be:ef:de:ad + - increased disk size to 30GB + \ EOF : multi-line-options @@ -152,6 +157,16 @@ \ EOI } + + : changes + : + $* <'stdin:5:9: error: empty machine changes' == 1 + : 1 + id: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + name: windows_10-msvc_14 + summary: Windows 10 build 1607 with VC 14 update 3 + changes: + EOI } : missed -- cgit v1.1