IPMI Watchdog - Gerrit Reviewer Comment Changes

Create a new branch for latest IPMI Watchdog changes.

Add changes from gerrit reviewer comments.

Rebase from gerrit/master and commit

Abandoned previous IPMI Watchdog MR and branches due to MR being
behind master branch by many commits and having a merge conflict.

Change-Id: If9bacf307982870c5d0e2dbe56a14145dc0ee4ce
Signed-off-by: Lee Tarlton <leet@ami.com>
diff --git a/data/ipmi_raw_cmd_table.py b/data/ipmi_raw_cmd_table.py
index 50b77f1..c25058a 100644
--- a/data/ipmi_raw_cmd_table.py
+++ b/data/ipmi_raw_cmd_table.py
@@ -215,4 +215,166 @@
             "0x0a 0x40"
         ]
     },
+    'Watchdog':
+    {
+        # Command action type
+        'Get':
+        [
+            # raw command, expected output(s), comment
+            "0x06 0x25",
+            "05 00 00 00 64 00",
+            "don't log bit enabled",
+            "85 00 00 00 64 00",
+            "don't log bit disabled",
+            "05 00 00 00 64 00",
+            "stop bit stop",
+            "45 00 00 00 64 00",
+            "stop bit resume",
+            "01 00 00 00 64 00",
+            "timer use FRB2",
+            "02 00 00 00 64 00",
+            "timer use POST",
+            "03 00 00 00 64 00",
+            "timer use OS",
+            "04 00 00 00 64 00",
+            "timer use SMS",
+            "05 00 00 00 64 00",
+            "timer use OEM",
+            "05 00 00 00 64 00",
+            "pre-timeout interrupt None",
+            "05 20 00 00 64 00",
+            "pre-timeout interrupt NMI",
+            "05 00 00 00 64 00",
+            "timeout action None",
+            "05 01 00 00 64 00",
+            "timeout action Reset",
+            "05 02 00 00 64 00",
+            "timeout action PowerDown",
+            "05 03 00 00 64 00",
+            "timeout action PowerCycle",
+            "01 00 00 02 00 00",
+            "timeout flag FRB2",
+            "02 00 00 04 00 00",
+            "timeout flag POST",
+            "03 00 00 08 00 00",
+            "timeout flag OS",
+            "04 00 00 10 00 00",
+            "timeout flag SMS",
+            "05 00 00 20 00 00",
+            "timeout flag OEM",
+            "05 00 00 00 30 35 30 35",
+            "Get should return 13.6 seconds",
+            "05 00 00 00 ff ff ff ff",
+            "Bit 6 not set when timer stopped",
+            "0x06 0x25 0x00",
+            "Get with one extra byte",
+        ],
+        'Set':
+        [
+            # raw command, expected output, comment
+            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "don't log bit enabled",
+            "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "don't log bit disabled",
+            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "stop bit stop",
+            "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "stop bit resume",
+            "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timer use FRB2",
+            "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timer use POST",
+            "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timer use OS",
+            "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timer use SMS",
+            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timer use OEM",
+            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "pre-timeout interrupt None",
+            "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00",
+            "none",
+            "pre-timeout interrupt NMI",
+            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
+            "none",
+            "timeout action None",
+            "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00",
+            "none",
+            "timeout action Reset",
+            "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00",
+            "none",
+            "timeout action PowerDown",
+            "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00",
+            "none",
+            "timeout action PowerCycle",
+            "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00",
+            "none",
+            "timeout flag FRB2",
+            "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00",
+            "none",
+            "timeout flag POST",
+            "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00",
+            "none",
+            "timeout flag OS",
+            "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00",
+            "none",
+            "timeout flag SMS",
+            "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00",
+            "none",
+            "timeout flag OEM",
+            "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00",
+            "none",
+            "Power down",
+            "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00",
+            "none",
+            "Hard reset",
+            "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00",
+            "none",
+            "Power cycle",
+            "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00",
+            "none",
+            "No action",
+            "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35",
+            "none",
+            "Set for 13.6 seconds",
+            "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00",
+            "none",
+            "Pre-timeout interval passes",
+            "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00",
+            "none",
+            "Pre-timeout interval fails",
+            "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF",
+            "none",
+            "Bit 6 not set when timer stopped",
+            "0x06 0x24 0x05 0x00 0x08 0x00 0x64",
+            "none",
+            "Set with one less byte",
+            "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00",
+            "none",
+            "Set with one extra byte",
+        ],
+        'Reset':
+        [
+            # raw command, expected output, comment
+            "0x06 0x22",
+            "none",
+            "Reset watchdog timer",
+            "0x06 0x22 0x00",
+            "none",
+            "Reset watchdog timer with extra byte",
+            "0x06 0x22",
+            "none",
+            "Reset watchdog timer without initialized watchdog",
+        ]
+    }
 }