Merge ~bladernr/plainbox-provider-checkbox:1794926-ipmi-user-list-channels into plainbox-provider-checkbox:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Rod Smith
Approved revision: 3b469888dbcc9aa04b1e2f524da76b6de69e1f61
Merged at revision: 08f9f0e612cfe90b2d6c3adfc2a5194b363119db
Proposed branch: ~bladernr/plainbox-provider-checkbox:1794926-ipmi-user-list-channels
Merge into: plainbox-provider-checkbox:master
Diff against target: 32 lines (+18/-1)
1 file modified
bin/ipmi_test (+18/-1)
Reviewer Review Type Date Requested Status
Rod Smith Approve
Jeff Lane  Needs Resubmitting
Review via email: mp+355862@code.launchpad.net

Description of the change

Fixes problem in ipmi_test where some systems use a different channel than 0.

To post a comment you must log in.
Revision history for this message
Rod Smith (rodsmith) wrote :

This works on about half a dozen systems that failed this test in 16.04.5 regression testing; however, there is one glitch -- see my inline comment.

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

Oh ... HAHAHAHA... crap. Rookie error. I spit out the message before
actually updating the variable... sigh...

One sec, I'll fix that and push an update.
On Fri, Sep 28, 2018 at 2:35 PM Rod Smith <email address hidden> wrote:
>
> Review: Needs Fixing
>
> This works on about half a dozen systems that failed this test in 16.04.5 regression testing; however, there is one glitch -- see my inline comment.
>
> Diff comments:
>
> > diff --git a/bin/ipmi_test b/bin/ipmi_test
> > index 71e7f36..59d7aac 100755
> > --- a/bin/ipmi_test
> > +++ b/bin/ipmi_test
> > @@ -28,10 +28,27 @@ done
> > echo
> > echo "Checking for chassis status"
> > ipmitool chassis status && echo "Successfully got chassis status" && chassis=0 || chassis=1
> > +
> > echo "Checking to see if we can get power status"
> > ipmitool power status && echo "Successfully got power status" && power=0 || power=1
> > +
> > echo "Checking to see if we can get user data"
> > -ipmitool user list && echo "Successfully got user data" && user=0 || user=1
> > +# LP:1794926 Find the active channel. blindly calling user list sometimes
> > +# fails.
> > +channel=99
> > +for x in 0 1 2 3 4 5 6 7 8 9 10 11 14 15; do
> > + if ipmitool channel getaccess $x 2>1 >/dev/null; then
> > + echo "Channel in use appears to be $channel"
> > + channel=$x
>
> There's something wrong around here. With every run, I get a claim that the channel in use is 99:
>
> Checking to see if we can get user data
> Channel in use appears to be 99
> ID Name Callin Link Auth IPMI Msg Channel Priv Limit
> 1 false false true ADMINISTRATOR
>
> This happens on every system I've tested (about half a dozen). Most of these actually use channel 1.
>
> > + break
> > + fi
> > +done
> > +if [ $channel -lt 99 ]; then
> > + ipmitool user list $channel && echo "Successfully got user data" && user=0 || user=1
> > +else
> > + user=1
> > +fi
> > +
> > echo "Checking to see if we can get info on the BMC"
> > ipmitool bmc info && echo "Successfully got BMC information" && bmc=0 || bmc=1
> >
>
>
> --
> https://code.launchpad.net/~bladernr/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/355862
> You are the owner of ~bladernr/plainbox-provider-checkbox:1794926-ipmi-user-list-channels.
>
> Launchpad-Message-Rationale: Owner
> Launchpad-Message-For: bladernr
> Launchpad-Notification-Type: code-review
> Launchpad-Branch: ~bladernr/plainbox-provider-checkbox/+git/plainbox-provider-checkbox:1794926-ipmi-user-list-channels
> Launchpad-Project: plainbox-provider-checkbox

--
Jeff Lane
Technical Partnership and Server Certification Programmes

"Entropy isn't what it used to be."

Revision history for this message
Jeff Lane  (bladernr) wrote :

Clicked the wrong thigns.. sigh... ok fixed the issue, thanks for catching that. I added that when removing the debug output I had while testing it, and simply placed it in the wrong location :/

review: Needs Resubmitting
Revision history for this message
Rod Smith (rodsmith) wrote :

OK, it's working now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/ipmi_test b/bin/ipmi_test
2index 71e7f36..12ca42c 100755
3--- a/bin/ipmi_test
4+++ b/bin/ipmi_test
5@@ -28,10 +28,27 @@ done
6 echo
7 echo "Checking for chassis status"
8 ipmitool chassis status && echo "Successfully got chassis status" && chassis=0 || chassis=1
9+
10 echo "Checking to see if we can get power status"
11 ipmitool power status && echo "Successfully got power status" && power=0 || power=1
12+
13 echo "Checking to see if we can get user data"
14-ipmitool user list && echo "Successfully got user data" && user=0 || user=1
15+# LP:1794926 Find the active channel. blindly calling user list sometimes
16+# fails.
17+channel=99
18+for x in 0 1 2 3 4 5 6 7 8 9 10 11 14 15; do
19+ if ipmitool channel getaccess $x 2>1 >/dev/null; then
20+ channel=$x
21+ echo "Channel in use appears to be $channel"
22+ break
23+ fi
24+done
25+if [ $channel -lt 99 ]; then
26+ ipmitool user list $channel && echo "Successfully got user data" && user=0 || user=1
27+else
28+ user=1
29+fi
30+
31 echo "Checking to see if we can get info on the BMC"
32 ipmitool bmc info && echo "Successfully got BMC information" && bmc=0 || bmc=1
33

Subscribers

People subscribed via source and target branches