Note

  • Maintenance Manager should log to maintenance.log file
  • Maintenance Manager should not crash or leak memory at any cost

Unsolicited Maintenance


Verify Unsolicited Maintenance (Maintenance on Bootup)

Feature: MaintenanceManager trigger on bootup
 
  Background:
    Given the system is Up with WPEFramework running
 
  Scenario: Verify unsolicited maintenance on every bootup
     Given the system is rebooted
     When the MaintenanceManager starts
     Then the MaintenanceManager should trigger all the Maintenance tasks
     And the Maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR

Solicited Maintenance


Verify Solicited Maintenance (Scheduled Maintenance)

Feature: Verify Solicited maintenance behavior (Maintenance Window)
 
  Background:
    Given the system has no active Maintenance running
 
  Scenario: Verify solicited maintenance execution
    Given the Maintenance is scheduled at a specific time
    And the current Maintenance status is not in progress
    When the scheduled maintenance time is reached
    Then the solicited Maintenance should execute all the Maintenance tasks
    And the maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR
    And the default behavior is to set "isRebootPending" flag to true


Verify Solicited Maintenance (via RPC Call)

Feature: Verify Solicited Maintenance behavior (startMaintenance jsonPRC Test on an inactive Maintenance Cycle)
 
  Background:
    Given the system has no active Maintenance running
 
  Scenario: Verify solicited maintenance execution
    Given the current Maintenance status is not in progress
    When the startMaintenance jsonRPC is invoked
    Then the solicited maintenance should execute all the Maintenance tasks
    And the maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR
    And the default behavior is to set "isRebootPending" flag to true
    And the return response for RPC call should be true


Verify Solicited Maintenance (via RPC Call on an active Maintenance)

Feature: Verify Solicited Maintenance behavior (startMaintenance jsonPRC Test on an active Maintenance Cycle)
 
  Background:
    Given the system has an active Maintenance running
 
  Scenario: Verify solicited maintenance invocation during active maintenance
    Given the current Maintenance status is in progress
    When the startMaintenance jsonRPC is invoked
    Then the solicited maintenance should not start any new tasks
    And the return response for RPC call should be false
    And the current running Maintenance tasks should proceed
    And the final Maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR
    And the "isRebootPending" flag should be true

JsonRPC 


Verify stopMaintenance on an active Maintenance Cycle

Feature: Verify stopMaintenance jsonPRC on an active Maintenance Cycle
 
  Background:
    Given the system has an active Maintenance running
 
  Scenario: Verify stop maintenance when maintenance is in progress
    Given the current Maintenance status is in progress
    When the stopMaintenance jsonRPC is invoked
    Then the currently running tasks should be aborted immediately
    And the maintenance status should be MAINTENANCE_ERROR
    And the return response should be true


Verify stopMaintenance on an inactive Maintenance

Feature: Verify stopMaintenance jsonPRC on an active Maintenance Cycle
 
  Background:
    Given the system has no Maintenance running i.e Maintenance is either in MAINTENANCE_ERROR/ MAINTENANCE_COMPLETE
 
  Scenario: Verify stop maintenance when no maintenance is active
    Given the current Maintenance status is not in progress
    When the stopMaintenance jsonRPC is invoked
    Then no maintenance tasks should be stopped or aborted
    And the maintenance status should remain unchanged
    And the return response should be false


Maintenance on No Internet

Feature: Test Maintenance Manager behavior when there is no internet
 
  Background:
    Given the system is configured to perform maintenance tasks
 
  Scenario: Handle no internet connection during maintenance
    Given the device has no internet connection
    When the maintenance manager starts
    Then the maintenance Manager should subscribe to network event
    Then the maintenance manager should check the network status 4 times
    And there should be a 30-second delay between each retry
    And if there is still no internet connection after retries, the maintenance manager subscribes to Network Event
    And the maintenance status should be set to MAINTENANCE_ERROR
    And no maintenance tasks should run


Maintenance on No Internet, then reconnected

Feature: Test Maintenance Manager behavior when there is no internet
 
  Background:
    Given the system is configured to perform maintenance tasks and Network Plugin is active after some time
 
  Scenario: Handle internet reconnection
    Given the device has no internet connection
    When the maintenance manager starts
    Then the maintenance Manager should subscribe to network event
    Then the maintenance manager should check the network status 4 times
    And there should be a 30-second delay between each retry
    And if there is still no internet connection after retries, the maintenance manager subscribes to Network Event
    And the maintenance status should be set to MAINTENANCE_ERROR
    And no maintenance tasks should run
 
    When the internet is reconnected and the maintenance manager receives FULLY_CONNECTED event
    Then the maintenance manager should trigger critical tasks like RFC and xconfImageCheck
    And the maintenance status should remain MAINTENANCE_ERROR
    And no maintenance tasks should run


getMaintenanceActivityStatus jsonRPC

Feature: Test Maintenance Manager getMaintenanceActivityStatus jsonRPC Call
 
  Background:
    Given the system is configured to perform maintenance tasks
 
  Scenario: Verify getMaintenanceActivityStatus returns the correct status information
    Given the system has completed a maintenance activity with status MAINTENANCE_ERROR
    When the getMaintenanceActivityStatus jsonRPC is invoked
    Then the response should include "maintenanceStatus" as either of MAINTENANCE_IDLE/ MAINTENANCE_STARTED/ MAINTENANCE_ERROR/ MAINTENANCE_COMPLETE
    And the response should include "LastSuccessfulCompletionTime" an integer value
    And the response should include "isCriticalMaintenance" be either true/ false
    And the response should include "isRebootPending" as true/ false
    And the response should include "success" as true


getMaintenanceStartTime jsonRPC returns Start Time

Feature: Test Maintenance Manager getMaintenanceActivityStatus jsonRPC Call
 
  Background:
      Given the system is configured to provide maintenance start times based on UTC in Unix epoch time
 
   Scenario: Verify getMaintenanceStartTime returns a valid future time window
    Given the system is scheduled for a future maintenance activity
    When the getMaintenanceStartTime jsonRPC is invoked
    Then the response should include "maintenanceStartTime" as a positive Unix epoch time
    And the response should include "success" as true


getMaintenanceStartTime jsonRPC does not return Start Time

Feature: Test Maintenance Manager getMaintenanceActivityStatus jsonRPC Call
 
  Background:
      Given the system is configured to provide maintenance start times based on UTC in Unix epoch time
 
   Scenario: Verify getMaintenanceStartTime handles the absence of a maintenance schedule
    Given the system has no scheduled maintenance/ no timeStamp files like /opt/persistent/timeZoneDST, etc
    When the getMaintenanceStartTime jsonRPC is invoked
    Then the response should include "maintenanceStartTime" as -1
    And the response should include "success" as true

Suppress Maintenance


Maintenance Manager behavior on Suppress Maintenance

Feature: Test Maintenance Manager behavior when SUPPRESS_MAINTENANCE is enabled
 
  Background:
      Given SUPPRESS_MAINTENANCE is enabled
 
   Scenario: Execute all tasks when device activation status does not require skipping firmware
    Given the device activation status is ACTIVATED/ ACTIVATION_DISCONNECT
    And the skipFirmware flag is set to false
    When the maintenance tasks are being executed
    Then the RFC task should be executed
    And the firmware download task should be executedd
    And the log upload task should be executed
    And the maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR


Maintenance Manager skips FWDOWNLOAD Task on Suppress Maintenance

Feature: Skip Firmware Task when SUPRESS_MAINTENANCE is enabled for Maintenance Manager
 
  Background:
      Given SUPPRESS_MAINTENANCE is enabled, and FWDOWNLOAD Task is skipped
 
   Scenario: Skip firmware task when device activation status requires it
    Given the device activation status is NOT_ACTIVATED/ ACTIVATION_READY/ ACTIVATION_CONNECT
    And the skipFirmware flag is set to true
    When the maintenance tasks are being executed
    Then the RFC task should be executed
    And the firmware download task should be skipped
    And the log upload task should be executed
    And the maintenance status should be MAINTENANCE_COMPLETE/ MAINTENANCE_ERROR

WhoAmI


Verify Unsolicited Maintenance (Maintenance on Bootup when WhoAmI is enabled)

Feature: MaintenanceManager trigger on bootup when ENABLE_WHOAMI flag is enabled
 
  Background:
    Given the system is Up with WPEFramework running, Authservice and SecManager Plugins are active and running
 
  Scenario: Verify unsolicited maintenance on every bootup
     Given the WhoAmI enabled system is rebooted
     When the MaintenanceManager is initialized
     And MaintenanceManager should subscribe to SecManager Plugin for onDeviceInitializationContextUpdate Event
     And MaintenanceManager should get the ActivationStatus of the device
     And MaintenanceManager should call getDeviceInitializationContext API to get the Device Context
         When received the context data
            The context should be set to respective RFCs and Continue with task execution
         When context is not received
            When the SecManager is active, the MaintenanceManager should wait for Context Event
            When SecManager sends the Context Event MaintenanceManager
            The context should be set to respective RFCs and Continue with task execution
     Then the MaintenanceManager should trigger all the Maintenance tasks
     And the Maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR


1.

Reboot      

Verify unsolicited maintenance on every bootup

Maintenance manager should trigger all the 4 maintenance tasks on bootup and maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR

2.

Maintenance should not be in progress

Verify solicited maintenance

Maintenance should happened at the scheduled time. It should execute all the above mentioned 3 tasks and  maintenance status should be MAINTENANCE_COMPLETE or MAINTENANCE_ERROR. Verify "isRebootPending" flag is set as true.

3.

Maintenance in progress

Verify stop maintenance

Currently running tasks should be aborted immediately and maintenance status should be MAINTENANCE_ERROR

4.

Disconnect internet on bootup

Device should not connect to internet on first 2 mins

Device should exit from maintenance activities and maintenance status should be MAINTENANCE_ERROR

5.

Disconnect internet on bootup

MM should subscribe for network event

If there is no internet on first 2 mins, then device should exit from maintenance and MM should subscribe for network event. MM should trigger StartDCM_maintaince.sh and xconfImageCheck.sh once device got internet to start telemetry and RDM

6.

Reboot

Verify crash

Ensure there are no crashes in wpeframework due to Maintenance Manager. Check corelog.txt once maintenance completed

7.

Reboot

Verify maintenance completed successfully

Maintenance status should not be MAINTENANCE_STARTED for long time. It should moved to MAINTENANCE_COMPLETE or MAINTENANCE_ERROR as soon as maintenance completed

8.

Reboot

Maintenance Manager Api's should return either return true or false

Verify MM Api's returns success or failure response immediately. It should not hang for long time. 

9

Reboot

Verify whoAmI feature is not enabled in non xfinity entos platforms

whoAmI feature or code should not reflect in non whoAmI enabled platforms

10

Reboot

whoAmI lookup must happen on every bootup in whoAmI enabled platforms

Device should acquire gdi identity and should store the gdi response in respective RFC parameters

  • No labels