Code update reboots check

Fixes:
   - boot count set to zero in utils.robot
   - add boot count check in code update path
   - add check for kernel reboot btime persistency

Resolves openbmc/openbmc-test-automation#311

Change-Id: I35f11c28d4f162f9440ef426ee3da6c70b80985c
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index e616a7d..b012450 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -596,16 +596,16 @@
 
 Set BMC Reset Reference Time
     [Documentation]  Set current boot time as a reference and increment
-    ...               boot count.
+    ...              boot count.
 
     ${cur_btime}=  Get BMC Boot Time
-    Run Keyword If  ${cur_btime} > ${BOOT_TIME}
-    ...  Run Keywords
+    Run Keyword If  ${BOOT_TIME} == ${0} and ${BOOT_COUNT} == ${0}
     ...  Set Global Variable  ${BOOT_TIME}  ${cur_btime}
+    ...  ELSE IF  ${cur_btime} > ${BOOT_TIME}
+    ...  Run Keywords  Set Global Variable  ${BOOT_TIME}  ${cur_btime}
     ...  AND
     ...  Set Global Variable  ${BOOT_COUNT}  ${BOOT_COUNT + 1}
 
-
 Get BMC Boot Time
     [Documentation]  Get boot time from /proc/stat.