Patchwork [RESEND,2] UEFI: move the UEFI tests into the UEFI categroy (LP:#1207200)

login
register
mail settings
Submitter Ivan Hu
Date Aug. 16, 2013, 6:15 a.m.
Message ID <1376633737-2461-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/267553/
State Accepted
Headers show

Comments

Ivan Hu - Aug. 16, 2013, 6:15 a.m.
From: IvanHu <ivan.hu@canonical.com>

Moving the uefirtvariable, uefirttime and uefirtmisc UEFI runtime service
tests in the the UEFI category instead of using unsafe category in order
to make it more specific and let users to be more aware of the tests.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/lib/src/fwts_framework.c             |   10 ++++++++--
 src/uefi/csm/csm.c                       |    2 +-
 src/uefi/securebootcert/securebootcert.c |    2 +-
 src/uefi/uefirtmisc/uefirtmisc.c         |    2 +-
 src/uefi/uefirttime/uefirttime.c         |    2 +-
 src/uefi/uefirtvariable/uefirtvariable.c |    2 +-
 6 files changed, 13 insertions(+), 7 deletions(-)
Colin King - Aug. 30, 2013, 10:54 p.m.
On 16/08/13 07:15, Ivan Hu wrote:
> From: IvanHu <ivan.hu@canonical.com>
> 
> Moving the uefirtvariable, uefirttime and uefirtmisc UEFI runtime service
> tests in the the UEFI category instead of using unsafe category in order
> to make it more specific and let users to be more aware of the tests.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/src/fwts_framework.c             |   10 ++++++++--
>  src/uefi/csm/csm.c                       |    2 +-
>  src/uefi/securebootcert/securebootcert.c |    2 +-
>  src/uefi/uefirtmisc/uefirtmisc.c         |    2 +-
>  src/uefi/uefirttime/uefirttime.c         |    2 +-
>  src/uefi/uefirtvariable/uefirtvariable.c |    2 +-
>  6 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 1581681..28c2ce8 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -38,7 +38,8 @@
>  	 FWTS_FLAG_INTERACTIVE_EXPERIMENTAL |	\
>  	 FWTS_FLAG_POWER_STATES |		\
>  	 FWTS_FLAG_UTILS |			\
> -	 FWTS_FLAG_UNSAFE)
> +	 FWTS_FLAG_UNSAFE |			\
> +	 FWTS_FLAG_TEST_UEFI)
>  
>  static fwts_list tests_to_skip;
>  
> @@ -81,6 +82,7 @@ static fwts_option fwts_framework_options[] = {
>  	{ "filter-error-keep",	"",   1, "Keep errors that match any of the specified labels." },
>  	{ "acpica-debug",	"",   0, "Enable ACPICA debug/warning messages." },
>  	{ "acpica",		"",   1, "Enable ACPICA run time options." },
> +	{ "uefi",		"",   0, "Run UEFI tests." },
>  	{ NULL, NULL, 0, NULL }
>  };
>  
> @@ -227,6 +229,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
>  		{ "Power States",		FWTS_FLAG_POWER_STATES },
>  		{ "Utilities",			FWTS_FLAG_UTILS },
>  		{ "Unsafe",			FWTS_FLAG_UNSAFE },
> +		{ "UEFI",			FWTS_FLAG_TEST_UEFI },
>  		{ NULL,				0 },
>  	};
>  
> @@ -241,7 +244,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
>  			fwts_list_init(&sorted);
>  			fwts_list_foreach(item, &fwts_framework_test_list) {
>  				test = fwts_list_data(fwts_framework_test *, item);
> -				if ((test->flags & FWTS_FLAG_RUN_ALL) == categories[i].flag)
> +				if ((test->flags & FWTS_FLAG_RUN_ALL) & categories[i].flag)
>  					fwts_list_add_ordered(&sorted, test,
>  						fwts_framework_compare_test_name);
>  			}
> @@ -1130,6 +1133,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>  			if (fwts_framework_acpica_parse(fw, optarg) != FWTS_OK)
>  				return FWTS_ERROR;
>  			break;
> +		case 38: /* --uefi */
> +			fw->flags |= FWTS_FLAG_TEST_UEFI;
> +			break;
>  		}
>  		break;
>  	case 'a': /* --all */
> diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
> index f4468bc..16498fb 100644
> --- a/src/uefi/csm/csm.c
> +++ b/src/uefi/csm/csm.c
> @@ -112,6 +112,6 @@ static fwts_framework_ops csm_ops = {
>  	.minor_tests = csm_tests
>  };
>  
> -FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
>  
>  #endif
> diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
> index 4baf3a9..9fa469b 100644
> --- a/src/uefi/securebootcert/securebootcert.c
> +++ b/src/uefi/securebootcert/securebootcert.c
> @@ -388,4 +388,4 @@ static fwts_framework_ops securebootcert_ops = {
>  	.minor_tests = securebootcert_tests
>  };
>  
> -FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 8fd4b4c..d94b885 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -224,4 +224,4 @@ static fwts_framework_ops uefirtmisc_ops = {
>  	.minor_tests = uefirtmisc_tests
>  };
>  
> -FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 2094677..c02a1aa 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -497,4 +497,4 @@ static fwts_framework_ops uefirttime_ops = {
>  	.minor_tests = uefirttime_tests
>  };
>  
> -FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index e223f82..4425029 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -1654,4 +1654,4 @@ static fwts_framework_ops uefirtvariable_ops = {
>  	.options_check   = options_check,
>  };
>  
> -FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> 

Thanks Ivan

Keng-Yu, can you fix up the subject line of the patch, "categroy" should
be "category"

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung - Sept. 2, 2013, 1:16 a.m.
On 08/16/2013 02:15 PM, Ivan Hu wrote:
> From: IvanHu <ivan.hu@canonical.com>
>
> Moving the uefirtvariable, uefirttime and uefirtmisc UEFI runtime service
> tests in the the UEFI category instead of using unsafe category in order
> to make it more specific and let users to be more aware of the tests.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/lib/src/fwts_framework.c             |   10 ++++++++--
>   src/uefi/csm/csm.c                       |    2 +-
>   src/uefi/securebootcert/securebootcert.c |    2 +-
>   src/uefi/uefirtmisc/uefirtmisc.c         |    2 +-
>   src/uefi/uefirttime/uefirttime.c         |    2 +-
>   src/uefi/uefirtvariable/uefirtvariable.c |    2 +-
>   6 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 1581681..28c2ce8 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -38,7 +38,8 @@
>   	 FWTS_FLAG_INTERACTIVE_EXPERIMENTAL |	\
>   	 FWTS_FLAG_POWER_STATES |		\
>   	 FWTS_FLAG_UTILS |			\
> -	 FWTS_FLAG_UNSAFE)
> +	 FWTS_FLAG_UNSAFE |			\
> +	 FWTS_FLAG_TEST_UEFI)
>
>   static fwts_list tests_to_skip;
>
> @@ -81,6 +82,7 @@ static fwts_option fwts_framework_options[] = {
>   	{ "filter-error-keep",	"",   1, "Keep errors that match any of the specified labels." },
>   	{ "acpica-debug",	"",   0, "Enable ACPICA debug/warning messages." },
>   	{ "acpica",		"",   1, "Enable ACPICA run time options." },
> +	{ "uefi",		"",   0, "Run UEFI tests." },
>   	{ NULL, NULL, 0, NULL }
>   };
>
> @@ -227,6 +229,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
>   		{ "Power States",		FWTS_FLAG_POWER_STATES },
>   		{ "Utilities",			FWTS_FLAG_UTILS },
>   		{ "Unsafe",			FWTS_FLAG_UNSAFE },
> +		{ "UEFI",			FWTS_FLAG_TEST_UEFI },
>   		{ NULL,				0 },
>   	};
>
> @@ -241,7 +244,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
>   			fwts_list_init(&sorted);
>   			fwts_list_foreach(item, &fwts_framework_test_list) {
>   				test = fwts_list_data(fwts_framework_test *, item);
> -				if ((test->flags & FWTS_FLAG_RUN_ALL) == categories[i].flag)
> +				if ((test->flags & FWTS_FLAG_RUN_ALL) & categories[i].flag)
>   					fwts_list_add_ordered(&sorted, test,
>   						fwts_framework_compare_test_name);
>   			}
> @@ -1130,6 +1133,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>   			if (fwts_framework_acpica_parse(fw, optarg) != FWTS_OK)
>   				return FWTS_ERROR;
>   			break;
> +		case 38: /* --uefi */
> +			fw->flags |= FWTS_FLAG_TEST_UEFI;
> +			break;
>   		}
>   		break;
>   	case 'a': /* --all */
> diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
> index f4468bc..16498fb 100644
> --- a/src/uefi/csm/csm.c
> +++ b/src/uefi/csm/csm.c
> @@ -112,6 +112,6 @@ static fwts_framework_ops csm_ops = {
>   	.minor_tests = csm_tests
>   };
>
> -FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
>
>   #endif
> diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
> index 4baf3a9..9fa469b 100644
> --- a/src/uefi/securebootcert/securebootcert.c
> +++ b/src/uefi/securebootcert/securebootcert.c
> @@ -388,4 +388,4 @@ static fwts_framework_ops securebootcert_ops = {
>   	.minor_tests = securebootcert_tests
>   };
>
> -FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 8fd4b4c..d94b885 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -224,4 +224,4 @@ static fwts_framework_ops uefirtmisc_ops = {
>   	.minor_tests = uefirtmisc_tests
>   };
>
> -FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 2094677..c02a1aa 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -497,4 +497,4 @@ static fwts_framework_ops uefirttime_ops = {
>   	.minor_tests = uefirttime_tests
>   };
>
> -FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index e223f82..4425029 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -1654,4 +1654,4 @@ static fwts_framework_ops uefirtvariable_ops = {
>   	.options_check   = options_check,
>   };
>
> -FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
> +FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index 1581681..28c2ce8 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -38,7 +38,8 @@ 
 	 FWTS_FLAG_INTERACTIVE_EXPERIMENTAL |	\
 	 FWTS_FLAG_POWER_STATES |		\
 	 FWTS_FLAG_UTILS |			\
-	 FWTS_FLAG_UNSAFE)
+	 FWTS_FLAG_UNSAFE |			\
+	 FWTS_FLAG_TEST_UEFI)
 
 static fwts_list tests_to_skip;
 
@@ -81,6 +82,7 @@  static fwts_option fwts_framework_options[] = {
 	{ "filter-error-keep",	"",   1, "Keep errors that match any of the specified labels." },
 	{ "acpica-debug",	"",   0, "Enable ACPICA debug/warning messages." },
 	{ "acpica",		"",   1, "Enable ACPICA run time options." },
+	{ "uefi",		"",   0, "Run UEFI tests." },
 	{ NULL, NULL, 0, NULL }
 };
 
@@ -227,6 +229,7 @@  static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
 		{ "Power States",		FWTS_FLAG_POWER_STATES },
 		{ "Utilities",			FWTS_FLAG_UTILS },
 		{ "Unsafe",			FWTS_FLAG_UNSAFE },
+		{ "UEFI",			FWTS_FLAG_TEST_UEFI },
 		{ NULL,				0 },
 	};
 
@@ -241,7 +244,7 @@  static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
 			fwts_list_init(&sorted);
 			fwts_list_foreach(item, &fwts_framework_test_list) {
 				test = fwts_list_data(fwts_framework_test *, item);
-				if ((test->flags & FWTS_FLAG_RUN_ALL) == categories[i].flag)
+				if ((test->flags & FWTS_FLAG_RUN_ALL) & categories[i].flag)
 					fwts_list_add_ordered(&sorted, test,
 						fwts_framework_compare_test_name);
 			}
@@ -1130,6 +1133,9 @@  int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
 			if (fwts_framework_acpica_parse(fw, optarg) != FWTS_OK)
 				return FWTS_ERROR;
 			break;
+		case 38: /* --uefi */
+			fw->flags |= FWTS_FLAG_TEST_UEFI;
+			break;
 		}
 		break;
 	case 'a': /* --all */
diff --git a/src/uefi/csm/csm.c b/src/uefi/csm/csm.c
index f4468bc..16498fb 100644
--- a/src/uefi/csm/csm.c
+++ b/src/uefi/csm/csm.c
@@ -112,6 +112,6 @@  static fwts_framework_ops csm_ops = {
 	.minor_tests = csm_tests
 };
 
-FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
+FWTS_REGISTER("csm", &csm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
 
 #endif
diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
index 4baf3a9..9fa469b 100644
--- a/src/uefi/securebootcert/securebootcert.c
+++ b/src/uefi/securebootcert/securebootcert.c
@@ -388,4 +388,4 @@  static fwts_framework_ops securebootcert_ops = {
 	.minor_tests = securebootcert_tests
 };
 
-FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
+FWTS_REGISTER("securebootcert", &securebootcert_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV);
diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
index 8fd4b4c..d94b885 100644
--- a/src/uefi/uefirtmisc/uefirtmisc.c
+++ b/src/uefi/uefirtmisc/uefirtmisc.c
@@ -224,4 +224,4 @@  static fwts_framework_ops uefirtmisc_ops = {
 	.minor_tests = uefirtmisc_tests
 };
 
-FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
+FWTS_REGISTER("uefirtmisc", &uefirtmisc_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index 2094677..c02a1aa 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -497,4 +497,4 @@  static fwts_framework_ops uefirttime_ops = {
 	.minor_tests = uefirttime_tests
 };
 
-FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
+FWTS_REGISTER("uefirttime", &uefirttime_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index e223f82..4425029 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -1654,4 +1654,4 @@  static fwts_framework_ops uefirtvariable_ops = {
 	.options_check   = options_check,
 };
 
-FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);
+FWTS_REGISTER("uefirtvariable", &uefirtvariable_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_TEST_UEFI | FWTS_FLAG_UNSAFE | FWTS_FLAG_ROOT_PRIV);