From patchwork Tue Oct 27 13:43:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8BC561C for ; Tue, 27 Oct 2020 13:44:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97FD8218AC for ; Tue, 27 Oct 2020 13:44:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="bdReNmeS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97FD8218AC Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12854.33247 (Exim 4.92) (envelope-from ) id 1kXPGh-0001bE-Nj; Tue, 27 Oct 2020 13:44:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12854.33247; Tue, 27 Oct 2020 13:44:07 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGh-0001b7-JP; Tue, 27 Oct 2020 13:44:07 +0000 Received: by outflank-mailman (input) for mailman id 12854; Tue, 27 Oct 2020 13:44:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGg-0001b2-Az for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:06 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8df44da4-c4c6-4015-899c-7111f422603c; Tue, 27 Oct 2020 13:44:03 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGd-0007vu-NW for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGd-00023F-MO for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGb-0002Uo-Rf; Tue, 27 Oct 2020 13:44:01 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGg-0001b2-Az for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:06 +0000 X-Inumbo-ID: 8df44da4-c4c6-4015-899c-7111f422603c Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8df44da4-c4c6-4015-899c-7111f422603c; Tue, 27 Oct 2020 13:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=W8kgjbVEV7/nGoVLukrqwqdL8zpPCmjDYWvWoU+BKAk=; b=bdReNmeSoCnBKRfDwUoTsyN34u RRGfoqiebkV4ULig7/g08T7mo5/wbAB6juGozae7rwBpjdgbmvIszTHjaq5hAzeOyZ7dZXkfYzb0q 65elxdgA3K8NqnF+afNDJS9xYP1GmHAQ95++onQbt5FoKQr1+GX8bnWfmTEQqYFVUWGQ=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGd-0007vu-NW for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGd-00023F-MO for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGb-0002Uo-Rf; Tue, 27 Oct 2020 13:44:01 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 1/7] README: Fix a typo Date: Tue, 27 Oct 2020 13:43:48 +0000 Message-Id: <20201027134354.25561-2-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 Signed-off-by: Ian Jackson --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1703e076..ef6c4e60 100644 --- a/README +++ b/README @@ -655,7 +655,7 @@ HostProp__PowerILOM unsupported Fails whenever a power operation is needed msw [--apc6] - Control and APC masterswitch via SNMP. The SNMP + Control an APC masterswitch via SNMP. The SNMP community is `private'. See the `pdu-msw' script. ipmi [ [ []]] From patchwork Tue Oct 27 13:43:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860439 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFD2F697 for ; Tue, 27 Oct 2020 13:44:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7671321707 for ; Tue, 27 Oct 2020 13:44:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="QERZ262V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7671321707 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12857.33283 (Exim 4.92) (envelope-from ) id 1kXPGw-0001ky-MR; Tue, 27 Oct 2020 13:44:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12857.33283; Tue, 27 Oct 2020 13:44:22 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGw-0001kn-JI; Tue, 27 Oct 2020 13:44:22 +0000 Received: by outflank-mailman (input) for mailman id 12857; Tue, 27 Oct 2020 13:44:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGv-0001b2-7P for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:21 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a14440a3-c76a-4308-aae1-ceb979216295; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGd-0007vx-UJ for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGd-00023g-TN for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-7J; Tue, 27 Oct 2020 13:44:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGv-0001b2-7P for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:21 +0000 X-Inumbo-ID: a14440a3-c76a-4308-aae1-ceb979216295 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a14440a3-c76a-4308-aae1-ceb979216295; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=xllzJu2rVf2X8UnmOfyzoIVs8umEVd2ts2o3jPuGX7A=; b=QERZ262VuOMUg98KAxp3jEQxUj OcoMDfabWuGwEjNd/YgRs/CfWLM8/rKXq6mRNfOSyJu3PW2z8p1uNTZTZFRb3LBsJ0VB6w67d6IeN u4h7mudX1C74P9dWyiYR7M/U5DXd6cP92v/zxswYvUuwdxvxbVLMG63H7inddR5jhbXg=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGd-0007vx-UJ for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGd-00023g-TN for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:03 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-7J; Tue, 27 Oct 2020 13:44:02 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 2/7] pdu-snmp: Rename from pdu-msw Date: Tue, 27 Oct 2020 13:43:49 +0000 Message-Id: <20201027134354.25561-3-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 We are going to make this script control PDUs other than APC ones. No overall functional change for internal callers. Anyone out-of-tree using this script will need to change the name of the program they run. Signed-off-by: Ian Jackson --- Osstest/PDU/msw.pm | 2 +- README | 2 +- pdu-msw => pdu-snmp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename pdu-msw => pdu-snmp (95%) diff --git a/Osstest/PDU/msw.pm b/Osstest/PDU/msw.pm index 19d9f56b..614216d4 100644 --- a/Osstest/PDU/msw.pm +++ b/Osstest/PDU/msw.pm @@ -33,7 +33,7 @@ sub new { sub pdu_power_state { my ($mo, $on) = @_; my $onoff= $on ? "on" : "off"; - system_checked("./pdu-msw @{ $mo->{Args} } $onoff"); + system_checked("./pdu-snmp @{ $mo->{Args} } $onoff"); } 1; diff --git a/README b/README index ef6c4e60..70f8ae73 100644 --- a/README +++ b/README @@ -656,7 +656,7 @@ HostProp__PowerILOM msw [--apc6] Control an APC masterswitch via SNMP. The SNMP - community is `private'. See the `pdu-msw' script. + community is `private'. See the `pdu-snmp' script. ipmi [ [ []]] Use IPMI by (by running ipmitool). is the name or diff --git a/pdu-msw b/pdu-snmp similarity index 95% rename from pdu-msw rename to pdu-snmp index c57f9f7c..581a60b0 100755 --- a/pdu-msw +++ b/pdu-snmp @@ -19,7 +19,7 @@ my $usagemsg= <[2] ? '*' : ''), $t->[0], $t->[1]); } - die "pdu-msw $dnsname: ". + die "pdu-snmp $dnsname: ". (@found ? "multiple ports match" : "no ports match"). "\n"; } @@ -119,7 +119,7 @@ sub get () { sub show () { my $mean = get(); - printf "pdu-msw $dnsname: #%s \"%s\" = %s\n", $useport, $usename, $mean; + printf "pdu-snmp $dnsname: #%s \"%s\" = %s\n", $useport, $usename, $mean; return $mean; } From patchwork Tue Oct 27 13:43:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6872F61C for ; Tue, 27 Oct 2020 13:45:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23CA421707 for ; Tue, 27 Oct 2020 13:45:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="cfmBjS2V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23CA421707 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12856.33271 (Exim 4.92) (envelope-from ) id 1kXPGr-0001gR-E6; Tue, 27 Oct 2020 13:44:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12856.33271; Tue, 27 Oct 2020 13:44:17 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGr-0001gG-9w; Tue, 27 Oct 2020 13:44:17 +0000 Received: by outflank-mailman (input) for mailman id 12856; Tue, 27 Oct 2020 13:44:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGq-0001b2-78 for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:16 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ca71bba4-5000-4fcb-9d25-00ed036ea09f; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w0-7T for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024D-5h for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-Eu; Tue, 27 Oct 2020 13:44:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGq-0001b2-78 for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:16 +0000 X-Inumbo-ID: ca71bba4-5000-4fcb-9d25-00ed036ea09f Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ca71bba4-5000-4fcb-9d25-00ed036ea09f; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=juiCgnMY9/QgNhWg1mZv5w6KyG10Ju4wvLuPHHdxwak=; b=cfmBjS2VvCrPXT2Enw1FWAmqvT +e13+JUKzFNeQ7nHxEEzB4eNuVRR8UJNo70aN+Eb7Hnpjqlp6KZ34HUA1tdHOYrsO9AbQMLpAiy85 +LT8/tLo2aelV1/pvS+qUY3siqYvkVbzKFZyHjhviEhlv5ANufpOWqQivOU37qULxlCA=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w0-7T for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024D-5h for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-Eu; Tue, 27 Oct 2020 13:44:02 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 3/7] pdu-snmp: Centralise base OIDs Date: Tue, 27 Oct 2020 13:43:50 +0000 Message-Id: <20201027134354.25561-4-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 Do not hardcoode .3 and .4 in the main logic. No functional change. Signed-off-by: Ian Jackson --- pdu-snmp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdu-snmp b/pdu-snmp index 581a60b0..a4918f53 100755 --- a/pdu-snmp +++ b/pdu-snmp @@ -27,8 +27,11 @@ use Net::SNMP; use Data::Dumper; my $community= 'private'; + my $baseoid= '.1.3.6.1.4.1.318.1.1.4.4.2.1'; my $baseoid_write= "$baseoid.3"; +my $baseoid_name= "$baseoid.4"; +my $baseoid_read= "$baseoid.3"; while (@ARGV && $ARGV[0] =~ m/^-/) { $_ = shift @ARGV; @@ -52,7 +55,7 @@ die "SNMP error $error " unless defined $session; sub getname ($) { my ($port) = @_; - my $oid= "$baseoid.4.$port"; + my $oid= "$baseoid_name.$port"; my $res= $session->get_request($oid); if ($res) { my $name= $res->{$oid}; @@ -96,7 +99,7 @@ if ($outlet =~ m/^\d+$/) { ($useport,$usename)= @{ $found[0] }; } -my $read_oid= "$baseoid.3.$useport"; +my $read_oid= "$baseoid_read.$useport"; my $write_oid= "$baseoid_write.$useport"; my @map= (undef, qw( From patchwork Tue Oct 27 13:43:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860447 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2BAF61C for ; Tue, 27 Oct 2020 13:45:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 79F0F21707 for ; Tue, 27 Oct 2020 13:45:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="En0amqcx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79F0F21707 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12859.33307 (Exim 4.92) (envelope-from ) id 1kXPH7-0001vk-9a; Tue, 27 Oct 2020 13:44:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12859.33307; Tue, 27 Oct 2020 13:44:33 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH7-0001vc-62; Tue, 27 Oct 2020 13:44:33 +0000 Received: by outflank-mailman (input) for mailman id 12859; Tue, 27 Oct 2020 13:44:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH5-0001b2-7V for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:31 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f23b889a-f9db-4df0-bd39-42713a532765; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w3-Ee for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024b-CL for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-MM; Tue, 27 Oct 2020 13:44:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH5-0001b2-7V for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:31 +0000 X-Inumbo-ID: f23b889a-f9db-4df0-bd39-42713a532765 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f23b889a-f9db-4df0-bd39-42713a532765; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0tVI4eo+1zS+zccZupV965ruxpbEgNilUw/RkAp3VIk=; b=En0amqcxDJ3ef96nNC1ptH1/zK DB0rGug4qsKF16JkFyfKhngx78Cuxc41vBRIfbC162XkQrjjxcSf4IpA3DNXg6Jo2MZYZMgDNf4iW Vzd4OsS/fTggZ3EFUAJuZBOkeisplk9C4E7vKbgo1t2kQ/GOMG/9Nfr2wqF+5o5he2Yg=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w3-Ee for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024b-CL for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-MM; Tue, 27 Oct 2020 13:44:02 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 4/7] pdu-snmp: Refactor model handling Date: Tue, 27 Oct 2020 13:43:51 +0000 Message-Id: <20201027134354.25561-5-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 This makes it easier to see waht is going on and to add new model(s). No functional change. Signed-off-by: Ian Jackson --- pdu-snmp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pdu-snmp b/pdu-snmp index a4918f53..74244145 100755 --- a/pdu-snmp +++ b/pdu-snmp @@ -28,15 +28,28 @@ use Data::Dumper; my $community= 'private'; -my $baseoid= '.1.3.6.1.4.1.318.1.1.4.4.2.1'; -my $baseoid_write= "$baseoid.3"; -my $baseoid_name= "$baseoid.4"; -my $baseoid_read= "$baseoid.3"; +our ($baseoid, $baseoid_write, $baseoid_name, $baseoid_read); + +sub model_msw () { + # APC MasterSwitch + $baseoid= '.1.3.6.1.4.1.318.1.1.4.4.2.1'; + $baseoid_name= "$baseoid.4"; + $baseoid_read= "$baseoid.3"; + $baseoid_write= "$baseoid.3"; +} + +sub model_apc6 () { + # APC MasterSwitch protocol version 6 (?) + model_msw(); + $baseoid_write= '.1.3.6.1.4.1.318.1.1.12.3.3.1.1.4'; +} + +my $model_name = 'msw'; while (@ARGV && $ARGV[0] =~ m/^-/) { $_ = shift @ARGV; - if (m/^--apc6$/) { - $baseoid_write= '.1.3.6.1.4.1.318.1.1.12.3.3.1.1.4'; + if (m/^--(\w+)$/ && ${*::}{"model_$1"}) { + $model_name= $1; } else { die "$_ ?"; } @@ -44,6 +57,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { if (@ARGV<2 || @ARGV>3 || $ARGV[0] =~ m/^-/) { die "bad usage\n$usagemsg"; } +${*::}{"model_$model_name"}->(); + our ($max_retries) = 16; # timeout = 0.05 * max_retries^2 our ($dnsname,$outlet,$action) = @ARGV; From patchwork Tue Oct 27 13:43:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860445 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46C3161C for ; Tue, 27 Oct 2020 13:45:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18627218AC for ; Tue, 27 Oct 2020 13:45:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="6No575w7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18627218AC Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12858.33295 (Exim 4.92) (envelope-from ) id 1kXPH1-0001q0-Vw; Tue, 27 Oct 2020 13:44:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12858.33295; Tue, 27 Oct 2020 13:44:27 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH1-0001pt-Rm; Tue, 27 Oct 2020 13:44:27 +0000 Received: by outflank-mailman (input) for mailman id 12858; Tue, 27 Oct 2020 13:44:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH0-0001b2-7W for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:26 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 711c59bb-aa35-4855-b496-b03771642e22; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w6-JZ for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024r-If for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-Td; Tue, 27 Oct 2020 13:44:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPH0-0001b2-7W for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:26 +0000 X-Inumbo-ID: 711c59bb-aa35-4855-b496-b03771642e22 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 711c59bb-aa35-4855-b496-b03771642e22; Tue, 27 Oct 2020 13:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=ht5aMArUMsbRZegTrAAwD7lR0CIO4rForYrTexZof/g=; b=6No575w7BLbLgwxOa+OluzfAhV eSOnAue4Va2681FC/CaJB3Z3jKGahvAu4JKegrHsj7GkzaGMVK2F6OVM3PPaeYF/GcOTz7zlSTvwR xVHz3Y9wyCMxKVmCCVfFfXzGJg2bsGjtaiyz7rq8UTE9qlfJAl6hV7qNiuPsVGn5Gx6I=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w6-JZ for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00024r-If for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGc-0002Uo-Td; Tue, 27 Oct 2020 13:44:02 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 5/7] pdu-snmp: Support ServerTech PDUs "Pro 1/2" aka "Sentry4" Date: Tue, 27 Oct 2020 13:43:52 +0000 Message-Id: <20201027134354.25561-6-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 Values from Sentry4.mib, from https://www.servertech.com/support/sentry-mib-oid-tree-downloads Useful runes used when developing and testing, with "Sentry.mib" from the Servertech zipfile renamed to "mibs/Sentry4-MIB": snmpwalk -On -m Sentry4-MIB -M +:mibs/ -Ci -v 2c -c private pdu1 iso.3.6.1.4.1.1718.4 snmpwalk -m Sentry4-MIB -M +:mibs/ -Ci -v 2c -c private pdu1 iso.3.6.1.4.1.1718.4 snmptranslate -Td -m Sentry4-MIB -M +:mibs/ Sentry4-MIB::st4OutletControlAction.1.1.2 Signed-off-by: Ian Jackson --- pdu-snmp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdu-snmp b/pdu-snmp index 74244145..61380766 100755 --- a/pdu-snmp +++ b/pdu-snmp @@ -44,6 +44,13 @@ sub model_apc6 () { $baseoid_write= '.1.3.6.1.4.1.318.1.1.12.3.3.1.1.4'; } +sub model_sentry4 () { + $baseoid = ".1.3.6.1.4.1.1718.4.1.8"; + $baseoid_name = "$baseoid.2.1.3.1.1"; # st4OutletName.1.1 + $baseoid_read = "$baseoid.3.1.1.1.1"; # st4OutletState.1.1 + $baseoid_write= "$baseoid.5.1.2.1.1"; # st4OutletControlAction.1.1 +} + my $model_name = 'msw'; while (@ARGV && $ARGV[0] =~ m/^-/) { From patchwork Tue Oct 27 13:43:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E74E461C for ; Tue, 27 Oct 2020 13:45:33 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC97221707 for ; Tue, 27 Oct 2020 13:45:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="KFP2JGzn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC97221707 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12863.33331 (Exim 4.92) (envelope-from ) id 1kXPHH-00027f-2C; Tue, 27 Oct 2020 13:44:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12863.33331; Tue, 27 Oct 2020 13:44:43 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHG-00027W-TS; Tue, 27 Oct 2020 13:44:42 +0000 Received: by outflank-mailman (input) for mailman id 12863; Tue, 27 Oct 2020 13:44:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHF-0001b2-7f for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:41 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2ba1eb07-fff5-4634-a0eb-c9e6eb2c3882; Tue, 27 Oct 2020 13:44:05 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w9-TI for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00025I-RV for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGd-0002Uo-4S; Tue, 27 Oct 2020 13:44:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHF-0001b2-7f for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:41 +0000 X-Inumbo-ID: 2ba1eb07-fff5-4634-a0eb-c9e6eb2c3882 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2ba1eb07-fff5-4634-a0eb-c9e6eb2c3882; Tue, 27 Oct 2020 13:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=wq7mzu+ToDMU3LijsJ/aE5ctMgAPIjBlbDtSDRbuAHo=; b=KFP2JGznwmC3nlWKz5vo4yJ1xs 6OHQE5SgihgX6Hoqr5tqEy/obBhH63LYdRCir5GTNPytlIkCZBBP7/Qewo4NfqlBJG0H/VvenCK2A da5yPGEz31JU6hu9nMFwqZqL7rCQW0je8S55Va7sUVMEocySGzQX0xqFnsnrdT3e8RPA=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGe-0007w9-TI for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGe-00025I-RV for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:04 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGd-0002Uo-4S; Tue, 27 Oct 2020 13:44:03 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 6/7] PDU::snmp, PDU::msw: Rename from msw to snmp Date: Tue, 27 Oct 2020 13:43:53 +0000 Message-Id: <20201027134354.25561-7-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 Retain the old name for compatibility with existing configuration. No change other than to messages. Signed-off-by: Ian Jackson --- Osstest/PDU/msw.pm | 14 +------------- Osstest/PDU/snmp.pm | 39 +++++++++++++++++++++++++++++++++++++++ README | 9 ++++++--- 3 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 Osstest/PDU/snmp.pm diff --git a/Osstest/PDU/msw.pm b/Osstest/PDU/msw.pm index 614216d4..099ef778 100644 --- a/Osstest/PDU/msw.pm +++ b/Osstest/PDU/msw.pm @@ -22,18 +22,6 @@ use warnings; use Osstest; -use parent qw(Osstest::PDU::unsupported); - -sub new { - my ($class, $ho, $methname, @args) = @_; - - return bless { Args => \@args }, $class; -} - -sub pdu_power_state { - my ($mo, $on) = @_; - my $onoff= $on ? "on" : "off"; - system_checked("./pdu-snmp @{ $mo->{Args} } $onoff"); -} +use parent qw(Osstest::PDU::snmp); 1; diff --git a/Osstest/PDU/snmp.pm b/Osstest/PDU/snmp.pm new file mode 100644 index 00000000..dca60df7 --- /dev/null +++ b/Osstest/PDU/snmp.pm @@ -0,0 +1,39 @@ +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2009-2013 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +package Osstest::PDU::snmp; + +use strict; +use warnings; + +use Osstest; + +use parent qw(Osstest::PDU::unsupported); + +sub new { + my ($class, $ho, $methname, @args) = @_; + + return bless { Args => \@args }, $class; +} + +sub pdu_power_state { + my ($mo, $on) = @_; + my $onoff= $on ? "on" : "off"; + system_checked("./pdu-snmp @{ $mo->{Args} } $onoff"); +} + +1; diff --git a/README b/README index 70f8ae73..33c4d2cc 100644 --- a/README +++ b/README @@ -654,9 +654,9 @@ HostProp__PowerILOM manual Asks the user on the controlling terminal unsupported Fails whenever a power operation is needed - msw [--apc6] - Control an APC masterswitch via SNMP. The SNMP - community is `private'. See the `pdu-snmp' script. + snmp -- + Control a PDU via SNMP. The SNMP community is `private'. + See the `pdu-snmp' script for supported model names. ipmi [ [ []]] Use IPMI by (by running ipmitool). is the name or @@ -667,6 +667,9 @@ HostProp__PowerILOM Does nothing if `on|off|both' is inapplicable, and has less error checking and less defaulting than ipmi. + msw .... + Deprecated alias for snmp. + Supported specially are: From patchwork Tue Oct 27 13:43:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11860449 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDE9792C for ; Tue, 27 Oct 2020 13:45:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA62D21707 for ; Tue, 27 Oct 2020 13:45:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xenproject.org header.i=@xenproject.org header.b="KlFM8E9w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA62D21707 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.12861.33319 (Exim 4.92) (envelope-from ) id 1kXPHB-00021D-MV; Tue, 27 Oct 2020 13:44:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 12861.33319; Tue, 27 Oct 2020 13:44:37 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHB-000212-HI; Tue, 27 Oct 2020 13:44:37 +0000 Received: by outflank-mailman (input) for mailman id 12861; Tue, 27 Oct 2020 13:44:36 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHA-0001b2-7X for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:36 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id af43575d-5cd1-4af6-bb2d-3a86862fcf7c; Tue, 27 Oct 2020 13:44:05 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGf-0007wE-45 for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:05 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGf-00025a-2Y for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:05 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGd-0002Uo-CI; Tue, 27 Oct 2020 13:44:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPHA-0001b2-7X for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:36 +0000 X-Inumbo-ID: af43575d-5cd1-4af6-bb2d-3a86862fcf7c Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id af43575d-5cd1-4af6-bb2d-3a86862fcf7c; Tue, 27 Oct 2020 13:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=DE/eoGAmQvD+pJdKoW0UhbHdlhrfKgbDNu4rZs20/uA=; b=KlFM8E9wKq0F2iUIWL+fguCwQj cD64qTWKnBO0zJ//jOJarmRAjQpJ/L8nlLnmUZkONYdseez/s+svFoBQ1Bkw8bczaqc4wiCLyr2bS X8NcKnn9hZUr/9NPkFBEQDNx2LhuF/KEka11c7GUOLkIRZI8u1NZgL4Vaj1yGRWBHp9s=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kXPGf-0007wE-45 for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:05 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kXPGf-00025a-2Y for xen-devel@lists.xenproject.org; Tue, 27 Oct 2020 13:44:05 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kXPGd-0002Uo-CI; Tue, 27 Oct 2020 13:44:03 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH 7/7] pdu-snmp: Fix sleeping Date: Tue, 27 Oct 2020 13:43:54 +0000 Message-Id: <20201027134354.25561-8-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027134354.25561-1-iwj@xenproject.org> References: <20201027134354.25561-1-iwj@xenproject.org> MIME-Version: 1.0 sleep takes only an integer. We have to use select to sleep for fractions of a second. Signed-off-by: Ian Jackson --- pdu-snmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdu-snmp b/pdu-snmp index 61380766..79d22e1f 100755 --- a/pdu-snmp +++ b/pdu-snmp @@ -172,7 +172,7 @@ if (!defined $action) { my $retries = 0; for (;;) { set($valset); - sleep $retries * 0.1; + select undef,undef,undef, $retries * 0.1; print "now: "; my $got = show(); if ($got eq $map[$valset]) { last; } if ($map[$valset] !~ m{^(?:off|on)$}) {