Message ID | 1352355085-6932-1-git-send-email-ivan.hu@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 08/11/12 06:11, Ivan Hu wrote: > Add the fwts test which gets wakeup time using the UEFI runtime service > interfaces via efi_runtime driver. > > Signed-off-by: Ivan Hu <ivan.hu@canonical.com> > --- > src/uefi/uefirttime/uefirttime.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c > index 319ac76..280e48e 100644 > --- a/src/uefi/uefirttime/uefirttime.c > +++ b/src/uefi/uefirttime/uefirttime.c > @@ -313,9 +313,38 @@ static int uefirttime_test2(fwts_framework *fw) > return FWTS_OK; > } > > +static int uefirttime_test3(fwts_framework *fw) > +{ > + long ioret; > + struct efi_getwakeuptime getwakeuptime; > + uint64_t status; > + uint8_t enabled, pending; > + EFI_TIME efi_time; > + > + getwakeuptime.Enabled = &enabled; > + getwakeuptime.Pending = &pending; > + getwakeuptime.Time = &efi_time; > + getwakeuptime.status = &status; > + > + ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); > + if (ioret == -1) { > + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", > + "Failed to get wakeup time with UEFI runtime service."); > + return FWTS_ERROR; > + } > + > + if (!checktimefields(fw, getwakeuptime.Time)) > + return FWTS_ERROR; > + > + fwts_passed(fw, "UEFI runtime service GetWakeupTime interface test passed."); > + > + return FWTS_OK; > +} > + > static fwts_framework_minor_test uefirttime_tests[] = { > { uefirttime_test1, "Test UEFI RT service get time interface." }, > { uefirttime_test2, "Test UEFI RT service set time interface." }, > + { uefirttime_test3, "Test UEFI RT service get wakeup time interface." }, > { NULL, NULL } > }; > > Looks good. Thanks, Acked-by: Colin Ian King <colin.king@canonical.com>
On 11/08/2012 02:11 PM, Ivan Hu wrote: > Add the fwts test which gets wakeup time using the UEFI runtime service > interfaces via efi_runtime driver. > > Signed-off-by: Ivan Hu <ivan.hu@canonical.com> > --- > src/uefi/uefirttime/uefirttime.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c > index 319ac76..280e48e 100644 > --- a/src/uefi/uefirttime/uefirttime.c > +++ b/src/uefi/uefirttime/uefirttime.c > @@ -313,9 +313,38 @@ static int uefirttime_test2(fwts_framework *fw) > return FWTS_OK; > } > > +static int uefirttime_test3(fwts_framework *fw) > +{ > + long ioret; > + struct efi_getwakeuptime getwakeuptime; > + uint64_t status; > + uint8_t enabled, pending; > + EFI_TIME efi_time; > + > + getwakeuptime.Enabled = &enabled; > + getwakeuptime.Pending = &pending; > + getwakeuptime.Time = &efi_time; > + getwakeuptime.status = &status; > + > + ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); > + if (ioret == -1) { > + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", > + "Failed to get wakeup time with UEFI runtime service."); > + return FWTS_ERROR; > + } > + > + if (!checktimefields(fw, getwakeuptime.Time)) > + return FWTS_ERROR; > + > + fwts_passed(fw, "UEFI runtime service GetWakeupTime interface test passed."); > + > + return FWTS_OK; > +} > + > static fwts_framework_minor_test uefirttime_tests[] = { > { uefirttime_test1, "Test UEFI RT service get time interface." }, > { uefirttime_test2, "Test UEFI RT service set time interface." }, > + { uefirttime_test3, "Test UEFI RT service get wakeup time interface." }, > { NULL, NULL } > }; > > Acked-by: Alex Hung <alex.hung@canonical.com>
diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c index 319ac76..280e48e 100644 --- a/src/uefi/uefirttime/uefirttime.c +++ b/src/uefi/uefirttime/uefirttime.c @@ -313,9 +313,38 @@ static int uefirttime_test2(fwts_framework *fw) return FWTS_OK; } +static int uefirttime_test3(fwts_framework *fw) +{ + long ioret; + struct efi_getwakeuptime getwakeuptime; + uint64_t status; + uint8_t enabled, pending; + EFI_TIME efi_time; + + getwakeuptime.Enabled = &enabled; + getwakeuptime.Pending = &pending; + getwakeuptime.Time = &efi_time; + getwakeuptime.status = &status; + + ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); + if (ioret == -1) { + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", + "Failed to get wakeup time with UEFI runtime service."); + return FWTS_ERROR; + } + + if (!checktimefields(fw, getwakeuptime.Time)) + return FWTS_ERROR; + + fwts_passed(fw, "UEFI runtime service GetWakeupTime interface test passed."); + + return FWTS_OK; +} + static fwts_framework_minor_test uefirttime_tests[] = { { uefirttime_test1, "Test UEFI RT service get time interface." }, { uefirttime_test2, "Test UEFI RT service set time interface." }, + { uefirttime_test3, "Test UEFI RT service get wakeup time interface." }, { NULL, NULL } };
Add the fwts test which gets wakeup time using the UEFI runtime service interfaces via efi_runtime driver. Signed-off-by: Ivan Hu <ivan.hu@canonical.com> --- src/uefi/uefirttime/uefirttime.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)