# 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

   unassigned

      physicaldrive 1I:1:1
         Port: 1I
         Box: 1
         Bay: 1
         Status: OK
         Drive Type: Unassigned Drive
         Interface Type: SATA
         Size: 2 TB
         Native Block Size: 512
         Rotational Speed: 7200
         Firmware Revision: MK7OHPG3
         Serial Number: YFK70EZA
         Model: ATA     MB2000GBUPB
         SATA NCQ Capable: True
         SATA NCQ Enabled: True
         Current Temperature (C): 32
         Maximum Temperature (C): 36
         PHY Count: 1
         PHY Transfer Rate: 6.0Gbps
         Drive Authentication Status: OK
         Carrier Application Version: 11
         Carrier Bootloader Version: 6


'''

# => ctrl slot=2 ld 1 show

# 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


   unassigned

      physicaldrive 1I:1:1
         Port: 1I
         Box: 1
         Bay: 1
         Status: OK
         Drive Type: Unassigned Drive
         Interface Type: SATA
         Size: 2 TB
         Native Block Size: 512
         Rotational Speed: 7200
         Firmware Revision: MK7OHPG3
         Serial Number: YFK70EZA
         Model: ATA     MB2000GBUPB
         SATA NCQ Capable: True
         SATA NCQ Enabled: True
         Current Temperature (C): 32
         Maximum Temperature (C): 36
         PHY Count: 1
         PHY Transfer Rate: 6.0Gbps
         Drive Authentication Status: OK
         Carrier Application Version: 11
         Carrier Bootloader Version: 6


'''

# => ctrl slot=2 ld 1 show

CTRL_LD_SHOW_OUTPUT = sample('ctrl_ld_show')