# Path: hardware/hpacucli.py
# ALL_SHOW_REGEXP = re.compile(r'^(.*) in Slot ([0-9]+).*\(sn: (.*)\)', re.M)
# ERROR_REGEXP = re.compile('Error: (.*)', re.M)
# LOGICAL_REGEXP = re.compile(r'\s*logicaldrive (.*) \((.*), (.*), (.*)\)')
# PHYSICAL_REGEXP = re.compile(r'\s*physicaldrive (.*) \(.*, (.*), (.*), (.*)\)')
# PROMPT_REGEXP = re.compile('=> ')
# class Error(Exception):
# class Cli:
#     def __init__(self, value):
#     def __str__(self):
# def parse_ctrl_all_show(output):
# def _generic_parsing(line, status, ignore_list):
# def _parse_ctrl_d_disk_show(output):
# def _parse_ctrl_show(output):
# def _parse_ctrl_d_all_show(output, regexp):
# def parse_ctrl_ld_all_show(output):
# def parse_ctrl_pd_all_show(output):
# def parse_ctrl_show(output):
# def parse_ctrl_pd_disk_show(output):
# def parse_error(output):
# def parse_ctrl_ld_show(output):
#     def __init__(self, debug=False):
#     def launch(self):
#     def _sendline(self, line):
#     def ctrl_all_show(self):
#     def ctrl_show(self, ctrl):
#     def ctrl_pd_all_show(self, selector):
#     def ctrl_pd_disk_show(self, selector, disk):
#     def ctrl_ld_all_show(self, selector):
#     def ctrl_ld_show(self, selector, ldid):
#     def ctrl_delete(self, selector):
#     def ctrl_create_ld(self, selector, drives, raid):
# def detect():
# 
# Path: hardware/tests/utils.py
# def sample(name, mode='r'):
#     return open(os.path.join(_BASEDIR, 'samples', name), mode).read()


import unittest
import pexpect
from unittest import mock
from hardware import hpacucli
from hardware.tests.utils import sample
HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded)
   Bus Interface: PCI
   Slot: 0
   Serial Number: PEYHD0DRHBH2C9
   RAID 6 (ADG) Status: Enabled
   Controller Status: OK
   Hardware Revision: A
   Firmware Version: 1.65-0
   Wait for Cache Room: Disabled
   Surface Analysis Inconsistency Notification: Disabled
   Post Prompt Timeout: 15 secs
   Cache Board Present: True
   Cache Status: OK
   Drive Write Cache: Disabled
   Total Cache Size: 4.0
   Total Cache Memory Available: 3.8
   No-Battery Write Cache: Disabled
   SSD Caching RAID5 WriteBack Enabled: True
   SSD Caching Version: 2
   Cache Backup Power Source: Batteries
   Battery/Capacitor Count: 1
   Battery/Capacitor Status: OK
   SATA NCQ Supported: True
   Spare Activation Mode: Activate on physical drive failure (default)
   Controller Temperature (C): 49
   Capacitor Temperature  (C): 39
   Number of Ports: 4 Internal only
   Encryption: Not Set
   Express Local Encryption: False
   Driver Name: smartpqi

# Path: hardware/hpacucli.py
# ALL_SHOW_REGEXP = re.compile(r'^(.*) in Slot ([0-9]+).*\(sn: (.*)\)', re.M)
# ERROR_REGEXP = re.compile('Error: (.*)', re.M)
# LOGICAL_REGEXP = re.compile(r'\s*logicaldrive (.*) \((.*), (.*), (.*)\)')
# PHYSICAL_REGEXP = re.compile(r'\s*physicaldrive (.*) \(.*, (.*), (.*), (.*)\)')
# PROMPT_REGEXP = re.compile('=> ')
# class Error(Exception):
# class Cli:
#     def __init__(self, value):
#     def __str__(self):
# def parse_ctrl_all_show(output):
# def _generic_parsing(line, status, ignore_list):
# def _parse_ctrl_d_disk_show(output):
# def _parse_ctrl_show(output):
# def _parse_ctrl_d_all_show(output, regexp):
# def parse_ctrl_ld_all_show(output):
# def parse_ctrl_pd_all_show(output):
# def parse_ctrl_show(output):
# def parse_ctrl_pd_disk_show(output):
# def parse_error(output):
# def parse_ctrl_ld_show(output):
#     def __init__(self, debug=False):
#     def launch(self):
#     def _sendline(self, line):
#     def ctrl_all_show(self):
#     def ctrl_show(self, ctrl):
#     def ctrl_pd_all_show(self, selector):
#     def ctrl_pd_disk_show(self, selector, disk):
#     def ctrl_ld_all_show(self, selector):
#     def ctrl_ld_show(self, selector, ldid):
#     def ctrl_delete(self, selector):
#     def ctrl_create_ld(self, selector, drives, raid):
# def detect():
# 
# Path: hardware/tests/utils.py
# def sample(name, mode='r'):
#     return open(os.path.join(_BASEDIR, 'samples', name), mode).read()


# Path: hardware/tests/test_hpacucli.py
import unittest
import pexpect
from unittest import mock
from hardware import hpacucli
from hardware.tests.utils import sample

HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded)
   Bus Interface: PCI
   Slot: 0
   Serial Number: PEYHD0DRHBH2C9
   RAID 6 (ADG) Status: Enabled
   Controller Status: OK
   Hardware Revision: A
   Firmware Version: 1.65-0
   Wait for Cache Room: Disabled
   Surface Analysis Inconsistency Notification: Disabled
   Post Prompt Timeout: 15 secs
   Cache Board Present: True
   Cache Status: OK
   Drive Write Cache: Disabled
   Total Cache Size: 4.0
   Total Cache Memory Available: 3.8
   No-Battery Write Cache: Disabled
   SSD Caching RAID5 WriteBack Enabled: True
   SSD Caching Version: 2
   Cache Backup Power Source: Batteries
   Battery/Capacitor Count: 1
   Battery/Capacitor Status: OK
   SATA NCQ Supported: True
   Spare Activation Mode: Activate on physical drive failure (default)
   Controller Temperature (C): 49
   Capacitor Temperature  (C): 39
   Number of Ports: 4 Internal only
   Encryption: Not Set
   Express Local Encryption: False
   Driver Name: smartpqi

   Driver Version: Linux 1.1.4-130