From patchwork Wed Oct 7 12:09:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahesh J Salgaonkar X-Patchwork-Id: 1377985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C5tYZ1Z1rz9sTD for ; Wed, 7 Oct 2020 23:14:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=M7nL+g+Z; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C5tYZ0MrfzDqPj for ; Wed, 7 Oct 2020 23:14:26 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=mahesh@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=M7nL+g+Z; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4C5tSX2THmzDqNg for ; Wed, 7 Oct 2020 23:10:04 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 097C5lbZ062064 for ; Wed, 7 Oct 2020 08:10:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=oRlkiimjX0gkm3pvR72J7HmKCCBqz6xHgr+N9+h9ERI=; b=M7nL+g+ZG8cId8W+K1Ac4lbSSCRyqYFFcXIHgyi5vfqbeJNx0nB9PX3gtbGelzjrd6vN jzDqBAc0eh94xorKmSgcmKPUIaibnRPo6PTji9TXsW2hH7kGP4MyCwqeZ9DnPgwVSOLM RW7nq1zIrDO8YfEqo0LtqRjmfFClNC4J5yR1Dl96brEPjTiFfB04UHWfi9mrF73qd4NC Uxa+mqDVsQcEEQDRos5/fY0ua88UUn5G+tInP04pmOR8ivba9/1dKycOYnXXfGQlByTK j8vFTyABiwHNYgMaBLleuTihcgpxc8BMxBhV3P1m6aaO4MTOK2Q6cv24XmZo2699vnx2 6A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 341beavapr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Oct 2020 08:10:00 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 097C6630063181 for ; Wed, 7 Oct 2020 08:10:00 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 341beavap5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Oct 2020 08:10:00 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 097C8N5f024452; Wed, 7 Oct 2020 12:09:58 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03fra.de.ibm.com with ESMTP id 33xgx7t6yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Oct 2020 12:09:58 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 097C9tuM30998838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Oct 2020 12:09:56 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFCBBA4051; Wed, 7 Oct 2020 12:09:55 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4783BA404D; Wed, 7 Oct 2020 12:09:55 +0000 (GMT) Received: from [192.168.0.63] (unknown [9.199.48.78]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 7 Oct 2020 12:09:55 +0000 (GMT) From: Mahesh Salgaonkar To: skiboot list Date: Wed, 07 Oct 2020 17:39:54 +0530 Message-ID: <160207259450.2097386.8481830435250442056.stgit@jupiter> In-Reply-To: <160207247879.2097386.9393389763183654717.stgit@jupiter> References: <160207247879.2097386.9393389763183654717.stgit@jupiter> User-Agent: StGit/0.21 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-07_08:2020-10-06, 2020-10-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=2 phishscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010070079 Subject: [Skiboot] [PATCH v2 10/10] run-pel: Add additional tests with FRU callout section. X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasant Hegde Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Mahesh Salgaonkar --- core/test/run-pel.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/core/test/run-pel.c b/core/test/run-pel.c index 812c8996c..2d04592dc 100644 --- a/core/test/run-pel.c +++ b/core/test/run-pel.c @@ -58,6 +58,7 @@ int main(void) struct opal_err_info *opal_err_info = &err_TEST_ERROR; char *buffer; struct elog_user_data_section *tmp; + int i; dt_root = dt_new_root(""); dt_add_property_string(dt_root, "model", "run-pel-unittest"); @@ -113,6 +114,53 @@ int main(void) assert(size == create_pel_log(elog, pel_buf, size)); + /* Add single FRU callout with location code only. */ + i = elog->num_fru_callout++; + strcpy(elog->fru_callout[0].loc_code, "Hello World!"); + + size = pel_size(elog); + pel_buf = realloc(pel_buf, size); + assert(pel_buf); + + assert(size == create_pel_log(elog, pel_buf, size)); + + /* Add additional FRU callout with loc-code and part-no. */ + i = elog->num_fru_callout++; + strcpy(elog->fru_callout[i].loc_code, "Hello World2!"); + strcpy(elog->fru_callout[i].part_no, "PARTNO"); + + size = pel_size(elog); + pel_buf = realloc(pel_buf, size); + assert(pel_buf); + + assert(size == create_pel_log(elog, pel_buf, size)); + + /* Add additional FRU callout with loc-code, part-no and serial no. */ + i = elog->num_fru_callout++; + strcpy(elog->fru_callout[i].loc_code, "Hello World2!"); + strcpy(elog->fru_callout[i].part_no, "PARTNO"); + strcpy(elog->fru_callout[i].serial_no, "SERIALNO"); + + size = pel_size(elog); + pel_buf = realloc(pel_buf, size); + assert(pel_buf); + + assert(size == create_pel_log(elog, pel_buf, size)); + + /* Add maximum of 10 FRU callouts */ + for (i = elog->num_fru_callout; i < PEL_MAX_FRU_CALL_OUTS; i++) { + elog->num_fru_callout++; + strcpy(elog->fru_callout[i].loc_code, "Hello World2!"); + strcpy(elog->fru_callout[i].part_no, "PARTNO"); + strcpy(elog->fru_callout[i].serial_no, "SERIALNO"); + } + + size = pel_size(elog); + pel_buf = realloc(pel_buf, size); + assert(pel_buf); + + assert(size == create_pel_log(elog, pel_buf, size)); + free(pel_buf); free(elog);