Patchwork [2/2] efirtmisc: add UEFI runtime service QueryCapsuleCapabilities interface stress test

login
register
mail settings
Submitter Ivan Hu
Date Jan. 28, 2013, 8:44 a.m.
Message ID <1359362658-10072-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/216123/
State Accepted
Headers show

Comments

Ivan Hu - Jan. 28, 2013, 8:44 a.m.
Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirtmisc/uefirtmisc.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
Colin King - Jan. 29, 2013, 4:34 p.m.
On 28/01/13 08:44, Ivan Hu wrote:
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefirtmisc/uefirtmisc.c |   20 +++++++++++++++++++-
>   1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 8d7236c..8fd4b4c 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -181,7 +181,14 @@ static int uefirtmisc_test1(fwts_framework *fw)
>   static int uefirtmisc_test2(fwts_framework *fw)
>   {
>   	int ret;
> -	uint32_t multitesttime = 1024;
> +	uint32_t multitesttime = 512;
> +	uint32_t i;
> +
> +	uint32_t flag[] = { 0,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET};
>
>   	fwts_log_info(fw, "Stress testing for UEFI runtime service GetNextHighMonotonicCount interface.");
>   	ret = getnexthighmonotoniccount_test(fw, multitesttime);
> @@ -190,6 +197,17 @@ static int uefirtmisc_test2(fwts_framework *fw)
>
>   	fwts_passed(fw, "UEFI runtime service GetNextHighMonotonicCount interface stress test passed.");
>
> +	fwts_log_info(fw, "Stress testing UEFI runtime service QueryCapsuleCapabilities interface.");
> +	for (i = 0; i < (sizeof(flag)/(sizeof flag[0])); i++) {
> +		ret = querycapsulecapabilities_test(fw, multitesttime, flag[i]);
> +		if (ret == FWTS_SKIP)
> +			continue;
> +		if (ret != FWTS_OK)
> +			return ret;
> +		fwts_passed(fw, "UEFI runtime service QueryCapsuleCapabilities interface stress test with flag value 0x%" PRIx32 " passed.", flag[i]);
> +
> +	}
> +
>   	return FWTS_OK;
>   }
>
>
Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung - Jan. 31, 2013, 9:19 a.m.
On 01/28/2013 04:44 PM, Ivan Hu wrote:
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefirtmisc/uefirtmisc.c |   20 +++++++++++++++++++-
>   1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 8d7236c..8fd4b4c 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -181,7 +181,14 @@ static int uefirtmisc_test1(fwts_framework *fw)
>   static int uefirtmisc_test2(fwts_framework *fw)
>   {
>   	int ret;
> -	uint32_t multitesttime = 1024;
> +	uint32_t multitesttime = 512;
> +	uint32_t i;
> +
> +	uint32_t flag[] = { 0,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> +			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET};
>
>   	fwts_log_info(fw, "Stress testing for UEFI runtime service GetNextHighMonotonicCount interface.");
>   	ret = getnexthighmonotoniccount_test(fw, multitesttime);
> @@ -190,6 +197,17 @@ static int uefirtmisc_test2(fwts_framework *fw)
>
>   	fwts_passed(fw, "UEFI runtime service GetNextHighMonotonicCount interface stress test passed.");
>
> +	fwts_log_info(fw, "Stress testing UEFI runtime service QueryCapsuleCapabilities interface.");
> +	for (i = 0; i < (sizeof(flag)/(sizeof flag[0])); i++) {
> +		ret = querycapsulecapabilities_test(fw, multitesttime, flag[i]);
> +		if (ret == FWTS_SKIP)
> +			continue;
> +		if (ret != FWTS_OK)
> +			return ret;
> +		fwts_passed(fw, "UEFI runtime service QueryCapsuleCapabilities interface stress test with flag value 0x%" PRIx32 " passed.", flag[i]);
> +
> +	}
> +
>   	return FWTS_OK;
>   }
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
index 8d7236c..8fd4b4c 100644
--- a/src/uefi/uefirtmisc/uefirtmisc.c
+++ b/src/uefi/uefirtmisc/uefirtmisc.c
@@ -181,7 +181,14 @@  static int uefirtmisc_test1(fwts_framework *fw)
 static int uefirtmisc_test2(fwts_framework *fw)
 {
 	int ret;
-	uint32_t multitesttime = 1024;
+	uint32_t multitesttime = 512;
+	uint32_t i;
+
+	uint32_t flag[] = { 0,
+			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
+			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
+			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
+			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET};
 
 	fwts_log_info(fw, "Stress testing for UEFI runtime service GetNextHighMonotonicCount interface.");
 	ret = getnexthighmonotoniccount_test(fw, multitesttime);
@@ -190,6 +197,17 @@  static int uefirtmisc_test2(fwts_framework *fw)
 
 	fwts_passed(fw, "UEFI runtime service GetNextHighMonotonicCount interface stress test passed.");
 
+	fwts_log_info(fw, "Stress testing UEFI runtime service QueryCapsuleCapabilities interface.");
+	for (i = 0; i < (sizeof(flag)/(sizeof flag[0])); i++) {
+		ret = querycapsulecapabilities_test(fw, multitesttime, flag[i]);
+		if (ret == FWTS_SKIP)
+			continue;
+		if (ret != FWTS_OK)
+			return ret;
+		fwts_passed(fw, "UEFI runtime service QueryCapsuleCapabilities interface stress test with flag value 0x%" PRIx32 " passed.", flag[i]);
+
+	}
+
 	return FWTS_OK;
 }