Commit 7e4c2f1b authored by Jeff Booher-Kaeding's avatar Jeff Booher-Kaeding
Browse files

basic ekl parser done, map next

parent effcaf29
#SCT log parser
#https://stackoverflow.com/a/4391978
def find(lst, key, value):
for i, dic in enumerate(lst):
if dic[key] == value:
return i
return -1
#Were we intrept test logs into test dicts
def test_parser(string,current_group ="N/A",current_test_set="N/A"):
print(string)
#test_dict = {
# "name": "some test",
# "result": "pass",
# "test set": "some set",
# "group": "some group",
# "guid": "XXXXXX",
# "comment": "some comment"
# "log": "log output"
#}
pass
def ekl_parser (file):
#create our "database" dict
db_dict = dict()
current_group = "N/A"
current_set = "N/A"
for line in file:
#strip the line of | & || used for sepration
split_line = [string for string in line.split('|') if string != ""]
#print(split_line)
#TODO:I can skip TERM, but I feel like "\n" should be able to be handled in the above list comprehension
if split_line[0]=="TERM" or split_line[0]=="\n":
continue
#The "HEAD" tag is the only indcation we are on a new test set
if split_line[0]=="HEAD":
#split the header into test group and test set.
current_group, current_set = split_line[8].split('\\')
print("group:",current_group,"set:",current_set)
#print(split_line)
#FIXME: EKL file has a (in my opinion) bad line structure,
# sometime we see a line that consits ' dump of GOP->I\n'
#easiest way to skip is check for blank space in the first char
elif split_line[0][0] != " ":
split_test = [new_string for old_string in split_line for new_string in old_string.split(':')]
#print(split_test)
print("test:",split_test[2])
print(split_line[0],split_line[1])
return db_dict
def main():
with open("SCT/Overall/Summary.ekl","r",encoding="utf-16") as f:
ekl_parser(f.readlines())
main()
\ No newline at end of file
|HEAD|||0||14-07-2020|16:06:52|A0A8BED3-3D6F-4AD8-907A-84D52EE1543B|0x00010001|PlatformSpecificElements|UEFI Compliant Test|GenericTest\EFICompliantTest|No device path
F61F0F0A-64FE-40A6-9D7C-0746A230245F:PASS|UEFI Compliant - DEVICE_PATH protocol must exist:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_uefi.c:795:Status - Success, Expected - Success
02C017D7-1557-47D9-BCE9-87182D07910C:PASS|UEFI Compliant - DECOMPRESS protocol must exist:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_uefi.c:839:Status - Success, Expected - Success
3A07DC1B-53D1-4FAC-88AF-C72579EB07F2:PASS|UEFI Compliant - DevicePathUtility:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_uefi.c:904:Status - Success, Expected - Success
F6334F9B-B930-4ADB-A53B-76FA7B4C2762:PASS|UEFI Compliant - Globally Defined Variables:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_uefi.c:1507
|TERM|0000|14-07-2020|16:13229757697097735:27866469370953730|13792480017252352 12948063677054976:30399641082134528:27303274604396547
|HEAD|||0||14-07-2020|16:07:04|24D52C4C-AFEB-49EA-A777-8FE19F322066|0x00010000|MediaIoProtocols|RequiredUefiProtocols Tests|GenericTest\SbbrRequiredUefiProtocols|No device path
6092F275-19CA-413A-ACC8-60D6E0CA7054:PASS|MediaIoProtocols:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/SbbrRequiredUefiProtocols/BlackBoxTest/RequiredUefiProtocolsBBTestFunction.c:139:EFI_LOAD_FILE_PROTOCOL Found
|TERM|0000|14-07-2020|16:32088628381351943:12666807743676429|13229817826639872 13229830711541760:30399748456316928:30681270677667841
|HEAD|||0||14-07-2020|16:07:15|78F530DD-FE16-4DAF-A201-BCB9371503A2|0x00010000|OsDiskFormat|SBBR UEFI System Environment and Configuration Tests|GenericTest\SbbrSysEnvConfig|No device path
91D5B963-1DA8-4C1D-913E-D34BB3A73A1C:FAILURE|TestOsDiskFormat:/home/edhcha01/v2.4_Plus/arm-enterprise-acs/luv/build/tmp/work/aarch64-oe-linux/sbbr/v1.1+gitAUTOINC+b558bad254-r0/edk2/SctPkg/TestCase/UEFI/EFI/Generic/SbbrSysEnvConfig/BlackBoxTest/SysEnvConfigBBTestFunction.c:368:No Valid Boot Disk Found
B[Test Case]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment