Includes library modifications to allow access to AIN_4 (AIN_0 / 5)

Committer:
bryantaylor
Date:
Tue Sep 20 21:26:12 2016 +0000
Revision:
0:eafc3fd41f75
hackathon

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bryantaylor 0:eafc3fd41f75 1 """
bryantaylor 0:eafc3fd41f75 2 mbed SDK
bryantaylor 0:eafc3fd41f75 3 Copyright (c) 2011-2015 ARM Limited
bryantaylor 0:eafc3fd41f75 4
bryantaylor 0:eafc3fd41f75 5 Licensed under the Apache License, Version 2.0 (the "License");
bryantaylor 0:eafc3fd41f75 6 you may not use this file except in compliance with the License.
bryantaylor 0:eafc3fd41f75 7 You may obtain a copy of the License at
bryantaylor 0:eafc3fd41f75 8
bryantaylor 0:eafc3fd41f75 9 http://www.apache.org/licenses/LICENSE-2.0
bryantaylor 0:eafc3fd41f75 10
bryantaylor 0:eafc3fd41f75 11 Unless required by applicable law or agreed to in writing, software
bryantaylor 0:eafc3fd41f75 12 distributed under the License is distributed on an "AS IS" BASIS,
bryantaylor 0:eafc3fd41f75 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
bryantaylor 0:eafc3fd41f75 14 See the License for the specific language governing permissions and
bryantaylor 0:eafc3fd41f75 15 limitations under the License.
bryantaylor 0:eafc3fd41f75 16
bryantaylor 0:eafc3fd41f75 17 Author: Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>
bryantaylor 0:eafc3fd41f75 18
bryantaylor 0:eafc3fd41f75 19 """
bryantaylor 0:eafc3fd41f75 20
bryantaylor 0:eafc3fd41f75 21 import os.path
bryantaylor 0:eafc3fd41f75 22 from ioper_base import IOperTestCaseBase
bryantaylor 0:eafc3fd41f75 23
bryantaylor 0:eafc3fd41f75 24
bryantaylor 0:eafc3fd41f75 25 class IOperTest_FileStructure(IOperTestCaseBase):
bryantaylor 0:eafc3fd41f75 26
bryantaylor 0:eafc3fd41f75 27 def __init__(self, scope=None):
bryantaylor 0:eafc3fd41f75 28 IOperTestCaseBase.__init__(self, scope)
bryantaylor 0:eafc3fd41f75 29
bryantaylor 0:eafc3fd41f75 30 def if_file_exist(self, fname, fail_severity=None):
bryantaylor 0:eafc3fd41f75 31 file_path = os.path.join(self.param['mount_point'], fname)
bryantaylor 0:eafc3fd41f75 32 exist = os.path.isfile(file_path)
bryantaylor 0:eafc3fd41f75 33 tr_name = "FILE_EXIST(%s)" % fname.upper()
bryantaylor 0:eafc3fd41f75 34 if exist:
bryantaylor 0:eafc3fd41f75 35 self.result.append((self.PASS, tr_name, self.scope, "File '%s' exists" % file_path))
bryantaylor 0:eafc3fd41f75 36 else:
bryantaylor 0:eafc3fd41f75 37 self.result.append((fail_severity if fail_severity else self.ERROR, tr_name, self.scope, "File '%s' not found" % file_path))
bryantaylor 0:eafc3fd41f75 38
bryantaylor 0:eafc3fd41f75 39 def test(self, param=None):
bryantaylor 0:eafc3fd41f75 40 self.result = []
bryantaylor 0:eafc3fd41f75 41 if param:
bryantaylor 0:eafc3fd41f75 42 pass
bryantaylor 0:eafc3fd41f75 43 return self.result
bryantaylor 0:eafc3fd41f75 44
bryantaylor 0:eafc3fd41f75 45
bryantaylor 0:eafc3fd41f75 46 class IOperTest_FileStructure_Basic(IOperTest_FileStructure):
bryantaylor 0:eafc3fd41f75 47 def __init__(self, scope=None):
bryantaylor 0:eafc3fd41f75 48 IOperTest_FileStructure.__init__(self, scope)
bryantaylor 0:eafc3fd41f75 49
bryantaylor 0:eafc3fd41f75 50 def test(self, param=None):
bryantaylor 0:eafc3fd41f75 51 self.param = param
bryantaylor 0:eafc3fd41f75 52 self.result = []
bryantaylor 0:eafc3fd41f75 53 if param:
bryantaylor 0:eafc3fd41f75 54 self.if_file_exist('mbed.htm', self.ERROR)
bryantaylor 0:eafc3fd41f75 55 return self.result
bryantaylor 0:eafc3fd41f75 56
bryantaylor 0:eafc3fd41f75 57
bryantaylor 0:eafc3fd41f75 58 class IOperTest_FileStructure_MbedEnabled(IOperTest_FileStructure):
bryantaylor 0:eafc3fd41f75 59 def __init__(self, scope=None):
bryantaylor 0:eafc3fd41f75 60 IOperTest_FileStructure.__init__(self, scope)
bryantaylor 0:eafc3fd41f75 61
bryantaylor 0:eafc3fd41f75 62 def test(self, param=None):
bryantaylor 0:eafc3fd41f75 63 self.param = param
bryantaylor 0:eafc3fd41f75 64 self.result = []
bryantaylor 0:eafc3fd41f75 65 if param:
bryantaylor 0:eafc3fd41f75 66 self.if_file_exist('mbed.htm', self.ERROR)
bryantaylor 0:eafc3fd41f75 67 self.if_file_exist('DETAILS.TXT', self.ERROR)
bryantaylor 0:eafc3fd41f75 68 self.if_file_exist('FAIL.TXT', self.INFO)
bryantaylor 0:eafc3fd41f75 69 return self.result