diff mbox series

[1/4] uefirttime: check time services supported before testing (LP: #1913351)

Message ID 20210513100145.29713-1-ivan.hu@canonical.com
State Accepted
Headers show
Series [1/4] uefirttime: check time services supported before testing (LP: #1913351) | expand

Commit Message

Ivan Hu May 13, 2021, 10:01 a.m. UTC
UEFI runtime tests are being done without checking RTPROT table which
intruduced after UEFI 2.8a. This might lead to false alarm for those
unsupported runtime service platforms. Add checking the time services
supported status before runing the related tests.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirttime/uefirttime.c | 84 ++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

Comments

Alex Hung May 13, 2021, 7:23 p.m. UTC | #1
On 2021-05-13 4:01 a.m., Ivan Hu wrote:
> UEFI runtime tests are being done without checking RTPROT table which
> intruduced after UEFI 2.8a. This might lead to false alarm for those
> unsupported runtime service platforms. Add checking the time services
> supported status before runing the related tests.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirttime/uefirttime.c | 84 ++++++++++++++++++++++++++++++++
>  1 file changed, 84 insertions(+)
> 
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index e2ab7d61..41503843 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -199,6 +199,12 @@ static int uefirttime_test1(fwts_framework *fw)
>  	EFI_TIME_CAPABILITIES efi_time_cap;
>  	uint64_t status = ~0ULL;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &efi_time;
>  	gettime.status = &status;
> @@ -234,6 +240,12 @@ static int uefirttime_test_gettime_invalid(
>  	struct efi_gettime gettime;
>  	uint64_t status = ~0ULL;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = efi_time_cap;
>  	gettime.Time = efi_time;
>  	gettime.status = &status;
> @@ -286,6 +298,12 @@ static int uefirttime_test4(fwts_framework *fw)
>  	EFI_TIME time;
>  	EFI_TIME_CAPABILITIES efi_time_cap;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
> @@ -330,6 +348,12 @@ static int uefirttime_test4(fwts_framework *fw)
>  		/* Unspecified timezone, local time */
>  		time.TimeZone = 2047;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	settime.Time = &time;
>  	status = ~0ULL;
>  	settime.status = &status;
> @@ -424,6 +448,12 @@ static int uefirttime_test_settime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	settime->status = &status;
>  
> @@ -460,6 +490,12 @@ static int uefirttime_test_settime_invalid_time(
>  	uint64_t status = ~0ULL;
>  	int ret, ioret;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
>  	gettime.Capabilities = NULL;
> @@ -500,6 +536,9 @@ static int uefirttime_test_settime_invalid_time(
>  
>  	ret = uefirttime_test_settime_invalid(fw, &settime);
>  
> +	if (ret == FWTS_SKIP)
> +		return ret;
> +
>  	/* Restore original time */
>  	settime.Time = &oldtime;
>  	status = ~0ULL;
> @@ -654,6 +693,12 @@ static int uefirttime_test18(fwts_framework *fw)
>  	uint8_t enabled, pending;
>  	EFI_TIME efi_time;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &efi_time;
> @@ -687,6 +732,12 @@ static int uefirttime_test_getwaketime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	getwakeuptime->status = &status;
>  
> @@ -777,6 +828,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  	struct efi_getwakeuptime getwakeuptime;
>  	uint8_t enabled, pending;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
> @@ -795,6 +852,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  		return FWTS_ERROR;
>  	}
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	/* change the hour, add 1 hour*/
>  	addonehour(&oldtime);
>  
> @@ -818,6 +881,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  
>  	sleep(1);
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &newtime;
> @@ -907,6 +976,12 @@ static int uefirttime_test_setwakeuptime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	setwakeuptime->status = &status;
>  
> @@ -954,6 +1029,12 @@ static int uefirttime_test_setwakeuptime_invalid_time(
>  	uint8_t pending, enabled;
>  	int ret, ioret;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &oldtime;
> @@ -996,6 +1077,9 @@ static int uefirttime_test_setwakeuptime_invalid_time(
>  
>  	ret = uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
>  
> +	if (ret == FWTS_SKIP)
> +		return ret;
> +
>  	/* Restore original time */
>  	setwakeuptime.Time = &oldtime;
>  	status = ~0ULL;
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King May 13, 2021, 9:48 p.m. UTC | #2
On 13/05/2021 11:01, Ivan Hu wrote:
> UEFI runtime tests are being done without checking RTPROT table which
> intruduced after UEFI 2.8a. This might lead to false alarm for those
> unsupported runtime service platforms. Add checking the time services
> supported status before runing the related tests.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirttime/uefirttime.c | 84 ++++++++++++++++++++++++++++++++
>  1 file changed, 84 insertions(+)
> 
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index e2ab7d61..41503843 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -199,6 +199,12 @@ static int uefirttime_test1(fwts_framework *fw)
>  	EFI_TIME_CAPABILITIES efi_time_cap;
>  	uint64_t status = ~0ULL;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &efi_time;
>  	gettime.status = &status;
> @@ -234,6 +240,12 @@ static int uefirttime_test_gettime_invalid(
>  	struct efi_gettime gettime;
>  	uint64_t status = ~0ULL;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = efi_time_cap;
>  	gettime.Time = efi_time;
>  	gettime.status = &status;
> @@ -286,6 +298,12 @@ static int uefirttime_test4(fwts_framework *fw)
>  	EFI_TIME time;
>  	EFI_TIME_CAPABILITIES efi_time_cap;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
> @@ -330,6 +348,12 @@ static int uefirttime_test4(fwts_framework *fw)
>  		/* Unspecified timezone, local time */
>  		time.TimeZone = 2047;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	settime.Time = &time;
>  	status = ~0ULL;
>  	settime.status = &status;
> @@ -424,6 +448,12 @@ static int uefirttime_test_settime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	settime->status = &status;
>  
> @@ -460,6 +490,12 @@ static int uefirttime_test_settime_invalid_time(
>  	uint64_t status = ~0ULL;
>  	int ret, ioret;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
>  	gettime.Capabilities = NULL;
> @@ -500,6 +536,9 @@ static int uefirttime_test_settime_invalid_time(
>  
>  	ret = uefirttime_test_settime_invalid(fw, &settime);
>  
> +	if (ret == FWTS_SKIP)
> +		return ret;
> +
>  	/* Restore original time */
>  	settime.Time = &oldtime;
>  	status = ~0ULL;
> @@ -654,6 +693,12 @@ static int uefirttime_test18(fwts_framework *fw)
>  	uint8_t enabled, pending;
>  	EFI_TIME efi_time;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &efi_time;
> @@ -687,6 +732,12 @@ static int uefirttime_test_getwaketime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	getwakeuptime->status = &status;
>  
> @@ -777,6 +828,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  	struct efi_getwakeuptime getwakeuptime;
>  	uint8_t enabled, pending;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	gettime.Capabilities = &efi_time_cap;
>  	gettime.Time = &oldtime;
>  	gettime.status = &status;
> @@ -795,6 +852,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  		return FWTS_ERROR;
>  	}
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	/* change the hour, add 1 hour*/
>  	addonehour(&oldtime);
>  
> @@ -818,6 +881,12 @@ static int uefirttime_test23(fwts_framework *fw)
>  
>  	sleep(1);
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &newtime;
> @@ -907,6 +976,12 @@ static int uefirttime_test_setwakeuptime_invalid(
>  	long ioret;
>  	static uint64_t status;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	status = ~0ULL;
>  	setwakeuptime->status = &status;
>  
> @@ -954,6 +1029,12 @@ static int uefirttime_test_setwakeuptime_invalid_time(
>  	uint8_t pending, enabled;
>  	int ret, ioret;
>  
> +	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
> +		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
> +			"service is not supported on this platform.");
> +		return FWTS_SKIP;
> +	}
> +
>  	getwakeuptime.Enabled = &enabled;
>  	getwakeuptime.Pending = &pending;
>  	getwakeuptime.Time = &oldtime;
> @@ -996,6 +1077,9 @@ static int uefirttime_test_setwakeuptime_invalid_time(
>  
>  	ret = uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
>  
> +	if (ret == FWTS_SKIP)
> +		return ret;
> +
>  	/* Restore original time */
>  	setwakeuptime.Time = &oldtime;
>  	status = ~0ULL;
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index e2ab7d61..41503843 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -199,6 +199,12 @@  static int uefirttime_test1(fwts_framework *fw)
 	EFI_TIME_CAPABILITIES efi_time_cap;
 	uint64_t status = ~0ULL;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	gettime.Capabilities = &efi_time_cap;
 	gettime.Time = &efi_time;
 	gettime.status = &status;
@@ -234,6 +240,12 @@  static int uefirttime_test_gettime_invalid(
 	struct efi_gettime gettime;
 	uint64_t status = ~0ULL;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	gettime.Capabilities = efi_time_cap;
 	gettime.Time = efi_time;
 	gettime.status = &status;
@@ -286,6 +298,12 @@  static int uefirttime_test4(fwts_framework *fw)
 	EFI_TIME time;
 	EFI_TIME_CAPABILITIES efi_time_cap;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	gettime.Capabilities = &efi_time_cap;
 	gettime.Time = &oldtime;
 	gettime.status = &status;
@@ -330,6 +348,12 @@  static int uefirttime_test4(fwts_framework *fw)
 		/* Unspecified timezone, local time */
 		time.TimeZone = 2047;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
+		fwts_skipped(fw, "Skipping test, SetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	settime.Time = &time;
 	status = ~0ULL;
 	settime.status = &status;
@@ -424,6 +448,12 @@  static int uefirttime_test_settime_invalid(
 	long ioret;
 	static uint64_t status;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) {
+		fwts_skipped(fw, "Skipping test, SetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	status = ~0ULL;
 	settime->status = &status;
 
@@ -460,6 +490,12 @@  static int uefirttime_test_settime_invalid_time(
 	uint64_t status = ~0ULL;
 	int ret, ioret;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	gettime.Time = &oldtime;
 	gettime.status = &status;
 	gettime.Capabilities = NULL;
@@ -500,6 +536,9 @@  static int uefirttime_test_settime_invalid_time(
 
 	ret = uefirttime_test_settime_invalid(fw, &settime);
 
+	if (ret == FWTS_SKIP)
+		return ret;
+
 	/* Restore original time */
 	settime.Time = &oldtime;
 	status = ~0ULL;
@@ -654,6 +693,12 @@  static int uefirttime_test18(fwts_framework *fw)
 	uint8_t enabled, pending;
 	EFI_TIME efi_time;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	getwakeuptime.Enabled = &enabled;
 	getwakeuptime.Pending = &pending;
 	getwakeuptime.Time = &efi_time;
@@ -687,6 +732,12 @@  static int uefirttime_test_getwaketime_invalid(
 	long ioret;
 	static uint64_t status;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	status = ~0ULL;
 	getwakeuptime->status = &status;
 
@@ -777,6 +828,12 @@  static int uefirttime_test23(fwts_framework *fw)
 	struct efi_getwakeuptime getwakeuptime;
 	uint8_t enabled, pending;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	gettime.Capabilities = &efi_time_cap;
 	gettime.Time = &oldtime;
 	gettime.status = &status;
@@ -795,6 +852,12 @@  static int uefirttime_test23(fwts_framework *fw)
 		return FWTS_ERROR;
 	}
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	/* change the hour, add 1 hour*/
 	addonehour(&oldtime);
 
@@ -818,6 +881,12 @@  static int uefirttime_test23(fwts_framework *fw)
 
 	sleep(1);
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	getwakeuptime.Enabled = &enabled;
 	getwakeuptime.Pending = &pending;
 	getwakeuptime.Time = &newtime;
@@ -907,6 +976,12 @@  static int uefirttime_test_setwakeuptime_invalid(
 	long ioret;
 	static uint64_t status;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, SetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	status = ~0ULL;
 	setwakeuptime->status = &status;
 
@@ -954,6 +1029,12 @@  static int uefirttime_test_setwakeuptime_invalid_time(
 	uint8_t pending, enabled;
 	int ret, ioret;
 
+	if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) {
+		fwts_skipped(fw, "Skipping test, GetWakeupTime runtime "
+			"service is not supported on this platform.");
+		return FWTS_SKIP;
+	}
+
 	getwakeuptime.Enabled = &enabled;
 	getwakeuptime.Pending = &pending;
 	getwakeuptime.Time = &oldtime;
@@ -996,6 +1077,9 @@  static int uefirttime_test_setwakeuptime_invalid_time(
 
 	ret = uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
 
+	if (ret == FWTS_SKIP)
+		return ret;
+
 	/* Restore original time */
 	setwakeuptime.Time = &oldtime;
 	status = ~0ULL;