[Fuego] [PATCH v2] rpm: Fix test case rpm02.

Tim.Bird at sony.com Tim.Bird at sony.com
Tue Feb 5 18:47:33 UTC 2019


I'm not sure I understand the issue here. 

Please see questions inline below.

> -----Original Message-----
> From: Zheng Ruoqin
> 
> In some user's boards, the rpm provided in this suite is not fit for them, and
> rpm can't be installed.
> 
> This patch provide an srpm file for user to rebuild it to produce the
> rpm file fit for them.
> 
> Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
> Signed-off-by: Qiu Tingting <qiutt at cn.fujitsu.com>
> ---
>  .../{ => data}/test-manual-1.2.3.noarch.rpm          | Bin
>  .../Functional.rpm/data/test-manual-1.2.3.src.rpm    | Bin 0 -> 2335 bytes
>  engine/tests/Functional.rpm/fuego_test.sh            |  19
> +++++++++++++++++--
>  engine/tests/Functional.rpm/tests/rpm_02.sh          |   2 +-
>  4 files changed, 18 insertions(+), 3 deletions(-)
>  rename engine/tests/Functional.rpm/{ => data}/test-manual-
> 1.2.3.noarch.rpm (100%)
>  create mode 100644 engine/tests/Functional.rpm/data/test-manual-
> 1.2.3.src.rpm
> 
> diff --git a/engine/tests/Functional.rpm/test-manual-1.2.3.noarch.rpm
> b/engine/tests/Functional.rpm/data/test-manual-1.2.3.noarch.rpm
> similarity index 100%
> rename from engine/tests/Functional.rpm/test-manual-1.2.3.noarch.rpm
> rename to engine/tests/Functional.rpm/data/test-manual-1.2.3.noarch.rpm
> diff --git a/engine/tests/Functional.rpm/data/test-manual-1.2.3.src.rpm
> b/engine/tests/Functional.rpm/data/test-manual-1.2.3.src.rpm
> new file mode 100644
> index
> 0000000000000000000000000000000000000000..9c0f45da76baed63ab88be262
> 18c90f813ab260f
> GIT binary patch
> literal 2335
> zcma)+c~DbV6o+2|Dn?OSsiGwiTo6=V-
> %DOzlBx(55drs|#W8QgSdu^%tEjc&0xlp3
> zZle~pfICH0MC%`nOJzivx@%o)s|7|-sue|%o*Qo++L_Mu&Yb-6-E-
> c#=iGbWYuMj-
> z+l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zUg#y>$_3HJDVyYZt7uO!i*WU`Axk}uA8;_417HQ0{fs{
> Ak^lez
> 
> literal 0
> HcmV?d00001
> 
> diff --git a/engine/tests/Functional.rpm/fuego_test.sh
> b/engine/tests/Functional.rpm/fuego_test.sh
> index 2a56a6d..b7856d8 100755
> --- a/engine/tests/Functional.rpm/fuego_test.sh
> +++ b/engine/tests/Functional.rpm/fuego_test.sh
> @@ -1,19 +1,34 @@
>  NEED_ROOT=1
> 
> +NEED_BUILD_RPM=false
>  function test_pre_check {
>      is_on_target_path rpm PROGRAM_RPM
>      assert_define PROGRAM_RPM
> +    is_on_target_path rpmbuild PROGRAM_RPMBUILD
> +    if [ -n $PROGRAM_RPMBUILD ];
> +    then
> +        NEED_BUILD_RPM=true
> +    fi

OK - just to clarify.  The logic here is that if a board has 'rpm' but not 'rpmbuild',
then just use the default test rpm package for the test.  But if a board has
the command 'rpmbuild' in the PATH, then use that to rebuild the
test rpm package, and use that instead of the default test rpm package.

Is that right?

What is deficient about the default test rpm package, that it cannot
be used in some circumstances?

I see that you are manipulating '_topdir' in the rebuild.  Is there some problem
with the test package touching things outside the Fuego test directory?

Can you provide an error message or log for when using the default test rpm
package fails on some board - that this fix is trying to address?

This is a fairly heavy-weight fix.  Not many embedded products will
have rpmbuild installed IMHO, so I hesitate to make that a requirement.
But it seems like the test still attempts to work even if 'rpmbuild' is missing.

But I want to get a sense for how many systems will have problems
with this test, in the case that rpmbuild is not present.

And I'm wondering if there's another way to resolve whatever problem
the test rpm package has (like maybe using --relocate option with 'rpm'
if there is some directory or path problem).

Thanks,
(Not applied yet)
 -- Tim


>  }
> 
>  function test_deploy {
>      put $TEST_HOME/rpm_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
> -    put $TEST_HOME/test-manual-1.2.3.noarch.rpm
> $BOARD_TESTDIR/fuego.$TESTDIR/
> +    put -r $TEST_HOME/data $BOARD_TESTDIR/fuego.$TESTDIR/
>      put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
>  }
> 
>  function test_run {
> +    if [ $NEED_BUILD_RPM ];
> +    then
> +        cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR; \
> +            mv /etc/rpm/platform /etc/rpm/platform.old; \
> +            rpmbuild --define \"_topdir \${dir:-
> $BOARD_TESTDIR/fuego.$TESTDIR/rpm}\" --rebuild data/test-manual-
> 1.2.3.src.rpm; \
> +            mv /etc/rpm/platform.old /etc/rpm/platform; \
> +            mv rpm/RPMS/noarch/test-manual-1.2.3-20181012.noarch.rpm
> data/test-manual-1.2.3.noarch.rpm"
> +    fi
>      report "cd $BOARD_TESTDIR/fuego.$TESTDIR; \
> -        sh -v rpm_test.sh"
> +        sh -v rpm_test.sh; \
> +        rpm -e test-manual"
>  }
> 
>  function test_processing {
> diff --git a/engine/tests/Functional.rpm/tests/rpm_02.sh
> b/engine/tests/Functional.rpm/tests/rpm_02.sh
> index 9b0f411..4a7de3b 100644
> --- a/engine/tests/Functional.rpm/tests/rpm_02.sh
> +++ b/engine/tests/Functional.rpm/tests/rpm_02.sh
> @@ -11,7 +11,7 @@ then
>      rpm -e $test_manual
>  fi
> 
> -rpm -ivh ${test_manual}.rpm --nodeps
> +rpm -ivh data/${test_manual}.rpm --nodeps
> 
>  if rpm -ql $test_manual | grep '.*/home/test/rpm-test/text1.txt.*'
>  then
> --
> 1.8.3.1
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list