Message ID | 1407491942-4148-1-git-send-email-ivan.hu@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 08/08/2014 05:59 PM, Ivan Hu wrote: > The setvariable_test2 tests the UEFI setvariable runtime service with the > same and different variable data. When doing the test, it should exist the > original variable on the system, the original variable should not be deleted. > > Signed-off-by: Ivan Hu <ivan.hu@canonical.com> > --- > src/uefi/uefirtvariable/uefirtvariable.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c > index 21a8cbc..6a22c80 100644 > --- a/src/uefi/uefirtvariable/uefirtvariable.c > +++ b/src/uefi/uefirtvariable/uefirtvariable.c > @@ -1012,35 +1012,25 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname) > if (ret != FWTS_OK) > goto err_restore_env1; > > - ret = setvariable_insertvariable(fw, attributes, 0, > - varname, >estguid1, datadiff1); > - if (ret != FWTS_OK) > - return ret; > - > /* insert different data */ > datasize = 20; > > ret = setvariable_insertvariable(fw, attributes, datasize, > varname, >estguid1, datadiff2); > if (ret != FWTS_OK) > - return ret; > + goto err_restore_env1; > > ret = setvariable_checkvariable(fw, datasize, varname, > >estguid1, datadiff2); > if (ret != FWTS_OK) > goto err_restore_env2; > > - ret = setvariable_insertvariable(fw, attributes, 0, > - varname, >estguid1, datadiff2); > - if (ret != FWTS_OK) > - return ret; > - > datasize = 5; > > ret = setvariable_insertvariable(fw, attributes, datasize, > varname, >estguid1, datadiff3); > if (ret != FWTS_OK) > - return ret; > + goto err_restore_env2; > > ret = setvariable_checkvariable(fw, datasize, varname, > >estguid1, datadiff3); > Acked-by: Alex Hung <alex.hung@canonical.com>
On Mon, Aug 11, 2014 at 10:26 AM, Alex Hung <alex.hung@canonical.com> wrote: > On 08/08/2014 05:59 PM, Ivan Hu wrote: >> The setvariable_test2 tests the UEFI setvariable runtime service with the >> same and different variable data. When doing the test, it should exist the >> original variable on the system, the original variable should not be deleted. >> >> Signed-off-by: Ivan Hu <ivan.hu@canonical.com> >> --- >> src/uefi/uefirtvariable/uefirtvariable.c | 14 ++------------ >> 1 file changed, 2 insertions(+), 12 deletions(-) >> >> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c >> index 21a8cbc..6a22c80 100644 >> --- a/src/uefi/uefirtvariable/uefirtvariable.c >> +++ b/src/uefi/uefirtvariable/uefirtvariable.c >> @@ -1012,35 +1012,25 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname) >> if (ret != FWTS_OK) >> goto err_restore_env1; >> >> - ret = setvariable_insertvariable(fw, attributes, 0, >> - varname, >estguid1, datadiff1); >> - if (ret != FWTS_OK) >> - return ret; >> - >> /* insert different data */ >> datasize = 20; >> >> ret = setvariable_insertvariable(fw, attributes, datasize, >> varname, >estguid1, datadiff2); >> if (ret != FWTS_OK) >> - return ret; >> + goto err_restore_env1; >> >> ret = setvariable_checkvariable(fw, datasize, varname, >> >estguid1, datadiff2); >> if (ret != FWTS_OK) >> goto err_restore_env2; >> >> - ret = setvariable_insertvariable(fw, attributes, 0, >> - varname, >estguid1, datadiff2); >> - if (ret != FWTS_OK) >> - return ret; >> - >> datasize = 5; >> >> ret = setvariable_insertvariable(fw, attributes, datasize, >> varname, >estguid1, datadiff3); >> if (ret != FWTS_OK) >> - return ret; >> + goto err_restore_env2; >> >> ret = setvariable_checkvariable(fw, datasize, varname, >> >estguid1, datadiff3); >> > > > Acked-by: Alex Hung <alex.hung@canonical.com> > Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 21a8cbc..6a22c80 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -1012,35 +1012,25 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname) if (ret != FWTS_OK) goto err_restore_env1; - ret = setvariable_insertvariable(fw, attributes, 0, - varname, >estguid1, datadiff1); - if (ret != FWTS_OK) - return ret; - /* insert different data */ datasize = 20; ret = setvariable_insertvariable(fw, attributes, datasize, varname, >estguid1, datadiff2); if (ret != FWTS_OK) - return ret; + goto err_restore_env1; ret = setvariable_checkvariable(fw, datasize, varname, >estguid1, datadiff2); if (ret != FWTS_OK) goto err_restore_env2; - ret = setvariable_insertvariable(fw, attributes, 0, - varname, >estguid1, datadiff2); - if (ret != FWTS_OK) - return ret; - datasize = 5; ret = setvariable_insertvariable(fw, attributes, datasize, varname, >estguid1, datadiff3); if (ret != FWTS_OK) - return ret; + goto err_restore_env2; ret = setvariable_checkvariable(fw, datasize, varname, >estguid1, datadiff3);
The setvariable_test2 tests the UEFI setvariable runtime service with the same and different variable data. When doing the test, it should exist the original variable on the system, the original variable should not be deleted. Signed-off-by: Ivan Hu <ivan.hu@canonical.com> --- src/uefi/uefirtvariable/uefirtvariable.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)