From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id A45541FF140 for ; Thu, 15 Jan 2026 13:47:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 33E2E1D00; Thu, 15 Jan 2026 13:47:58 +0100 (CET) Date: Thu, 15 Jan 2026 13:47:20 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20251219194511.840583-1-m.carrara@proxmox.com> <20251219194511.840583-9-m.carrara@proxmox.com> In-Reply-To: <20251219194511.840583-9-m.carrara@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1768473929.ep40chktyk.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1768481195679 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH pve-common v1 08/23] tests: sectionconfig: add case for unused required default properties X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On December 19, 2025 8:44 pm, Max R. Carrara wrote: > Add a PVE::SectionConfig test case for plugin systems that declare a > required default property (in `private()->{propertyList}`), but don't > use it in any child plugin (i.e. in `options()`). > > In both unified and isolated mode, such properties are required in > both create and update schema. should they be optional in the update schema? > > Signed-off-by: Max R. Carrara > --- > test/SectionConfig/schema_comparison_test.pl | 196 +++++++++++++++++++ > 1 file changed, 196 insertions(+) > > diff --git a/test/SectionConfig/schema_comparison_test.pl b/test/SectionConfig/schema_comparison_test.pl > index b49abfe..fd6724e 100755 > --- a/test/SectionConfig/schema_comparison_test.pl > +++ b/test/SectionConfig/schema_comparison_test.pl > @@ -1144,6 +1144,202 @@ package OptionalCommonRequiredByAll { > } > } > > +package RequiredCommonUnused { > + use base qw(TestPackage); > + > + sub desc($class) { > + return "for both unified and isolated mode, unused required default properties" > + . " are required in both schemas"; > + } > + > + package RequiredCommonUnused::PluginBase { > + use base qw(PVE::SectionConfig); > + > + my $DEFAULT_DATA = { > + propertyList => { > + common => { > + type => 'string', > + optional => 0, > + }, > + }, > + }; > + > + sub private($class) { > + return $DEFAULT_DATA; > + } > + }; > + > + package RequiredCommonUnused::PluginOne { > + use base qw(RequiredCommonUnused::PluginBase); > + > + sub type($class) { > + return 'one'; > + } > + > + sub properties($class) { > + return { > + 'prop-one' => { > + type => 'string', > + optional => 1, > + }, > + }; > + } > + > + sub options($class) { > + return { > + 'prop-one' => { > + optional => 1, > + }, > + }; > + } > + }; > + > + package RequiredCommonUnused::PluginTwo { > + use base qw(RequiredCommonUnused::PluginBase); > + > + sub type($class) { > + return 'two'; > + } > + > + sub properties($class) { > + return { > + 'prop-two' => { > + type => 'string', > + optional => 1, > + }, > + }; > + } > + > + sub options($class) { > + return { > + 'prop-two' => { > + optional => 1, > + }, > + }; > + } > + }; > + > + sub expected_unified_createSchema($class) { > + return { > + type => 'object', > + additionalProperties => 0, > + properties => { > + type => { > + type => 'string', > + enum => [ > + "one", "two", > + ], > + }, > + 'prop-one' => { > + type => 'string', > + optional => 1, > + }, > + 'prop-two' => { > + type => 'string', > + optional => 1, > + }, > + 'common' => { > + type => 'string', > + optional => 0, > + }, > + }, > + }; > + } > + > + sub expected_unified_updateSchema($class) { > + return { > + type => 'object', > + additionalProperties => 0, > + properties => { > + 'prop-one' => { > + type => 'string', > + optional => 1, > + }, > + 'prop-two' => { > + type => 'string', > + optional => 1, > + }, > + common => { > + type => 'string', > + optional => 0, > + }, > + $SectionConfig::Helpers::UPDATE_SCHEMA_DEFAULT_PROPERTIES->%*, > + }, > + }; > + } > + > + sub expected_isolated_createSchema($class) { > + return { > + type => 'object', > + additionalProperties => 0, > + properties => { > + type => { > + type => 'string', > + enum => [ > + "one", "two", > + ], > + }, > + 'prop-one' => { > + 'instance-types' => [ > + "one", > + ], > + 'type-property' => 'type', > + type => 'string', > + optional => 1, > + }, > + 'prop-two' => { > + 'instance-types' => [ > + "two", > + ], > + 'type-property' => 'type', > + type => 'string', > + optional => 1, > + }, > + 'common' => { > + type => 'string', > + optional => 0, > + }, > + }, > + }; > + } > + > + sub expected_isolated_updateSchema($class) { > + return { > + type => 'object', > + additionalProperties => 0, > + properties => { > + type => { > + type => 'string', > + enum => [ > + "one", "two", > + ], > + }, > + 'prop-one' => { > + 'instance-types' => [ > + "one", > + ], > + 'type-property' => 'type', > + type => 'string', > + optional => 1, > + }, > + 'prop-two' => { > + 'instance-types' => [ > + "two", > + ], > + 'type-property' => 'type', > + type => 'string', > + optional => 1, > + }, > + common => { > + type => 'string', > + optional => 0, > + }, > + $SectionConfig::Helpers::UPDATE_SCHEMA_DEFAULT_PROPERTIES->%*, > + }, > + }; > + } > +} > + > sub test_compare_deeply($got, $expected, $test_name, $test_package) { > $test_name = "$test_package - $test_name"; > my $description = $test_package->desc(); > -- > 2.47.3 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel