dts: fix DPDK git tarball cast bug

Message ID 20240719153445.277851-1-alex.chapman@arm.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series dts: fix DPDK git tarball cast bug |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Alex Chapman July 19, 2024, 3:34 p.m. UTC
When running DTS with a git revision specified the following error occurs:
$ ./main.py --revision HEAD
[...]
FileNotFoundError: [Errno 2] No such file or directory:
     'dts/<framework.utils.DPDKGitTarball object at 0x78f69e73a5c0>'

Fix by casting DPDKGitTarball to Path, in order to stringify it correctly.

Bugzilla ID: 1496
Fixes: a23f22457dbd ("dts: constrain DPDK source argument")

Signed-off-by: Alex Chapman <alex.chapman@arm.com>
Reviewed-by: Jack Bond-Preston <jack.bond-preston@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
Hello,
Sending this fix to a bug that i discovered.

Best Regards,
Alex
---
 .mailmap                  | 1 +
 dts/framework/settings.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
  

Comments

Juraj Linkeš July 22, 2024, 1:06 p.m. UTC | #1
Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>

Thanks for catching this.

On 19. 7. 2024 17:34, Alex Chapman wrote:
> When running DTS with a git revision specified the following error occurs:
> $ ./main.py --revision HEAD
> [...]
> FileNotFoundError: [Errno 2] No such file or directory:
>       'dts/<framework.utils.DPDKGitTarball object at 0x78f69e73a5c0>'
> 
> Fix by casting DPDKGitTarball to Path, in order to stringify it correctly.
> 
> Bugzilla ID: 1496
> Fixes: a23f22457dbd ("dts: constrain DPDK source argument")
> 
> Signed-off-by: Alex Chapman <alex.chapman@arm.com>
> Reviewed-by: Jack Bond-Preston <jack.bond-preston@arm.com>
> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
> ---
> Hello,
> Sending this fix to a bug that i discovered.
> 
> Best Regards,
> Alex
> ---
>   .mailmap                  | 1 +
>   dts/framework/settings.py | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.mailmap b/.mailmap
> index 3f3f0442e5..a326e8e553 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -46,6 +46,7 @@ Aleksey Baulin <aleksey.baulin@gmail.com>
>   Aleksey Katargin <gureedo@gmail.com>
>   Ales Musil <amusil@redhat.com>
>   Alessio Igor Bogani <alessio.bogani@elettra.eu>
> +Alex Chapman <alex.chapman@arm.com>
>   Alexander Bechikov <asb.tyum@gmail.com>
>   Alexander Belyakov <abelyako@gmail.com>
>   Alexander Chernavin <achernavin@netgate.com>
> diff --git a/dts/framework/settings.py b/dts/framework/settings.py
> index f95876113f..f6303066d4 100644
> --- a/dts/framework/settings.py
> +++ b/dts/framework/settings.py
> @@ -415,7 +415,7 @@ def get_settings() -> Settings:
>       args = parser.parse_args()
>   
>       if args.dpdk_revision_id:
> -        args.dpdk_tarball_path = DPDKGitTarball(args.dpdk_revision_id, args.output_dir)
> +        args.dpdk_tarball_path = Path(DPDKGitTarball(args.dpdk_revision_id, args.output_dir))
>   
>       args.test_suites = _process_test_suites(parser, args.test_suites)
>
  
Thomas Monjalon July 23, 2024, 9:43 p.m. UTC | #2
22/07/2024 15:06, Juraj Linkeš:
> 
> On 19. 7. 2024 17:34, Alex Chapman wrote:
> > When running DTS with a git revision specified the following error occurs:
> > $ ./main.py --revision HEAD
> > [...]
> > FileNotFoundError: [Errno 2] No such file or directory:
> >       'dts/<framework.utils.DPDKGitTarball object at 0x78f69e73a5c0>'
> > 
> > Fix by casting DPDKGitTarball to Path, in order to stringify it correctly.
> > 
> > Bugzilla ID: 1496
> > Fixes: a23f22457dbd ("dts: constrain DPDK source argument")
> > 
> > Signed-off-by: Alex Chapman <alex.chapman@arm.com>
> > Reviewed-by: Jack Bond-Preston <jack.bond-preston@arm.com>
> > Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> > Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
> > ---
> > Hello,
> > Sending this fix to a bug that i discovered.
> > 
> > Best Regards,
> > Alex
> > ---
> Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> 
> Thanks for catching this.

Applied, thanks and welcome.
  

Patch

diff --git a/.mailmap b/.mailmap
index 3f3f0442e5..a326e8e553 100644
--- a/.mailmap
+++ b/.mailmap
@@ -46,6 +46,7 @@  Aleksey Baulin <aleksey.baulin@gmail.com>
 Aleksey Katargin <gureedo@gmail.com>
 Ales Musil <amusil@redhat.com>
 Alessio Igor Bogani <alessio.bogani@elettra.eu>
+Alex Chapman <alex.chapman@arm.com>
 Alexander Bechikov <asb.tyum@gmail.com>
 Alexander Belyakov <abelyako@gmail.com>
 Alexander Chernavin <achernavin@netgate.com>
diff --git a/dts/framework/settings.py b/dts/framework/settings.py
index f95876113f..f6303066d4 100644
--- a/dts/framework/settings.py
+++ b/dts/framework/settings.py
@@ -415,7 +415,7 @@  def get_settings() -> Settings:
     args = parser.parse_args()
 
     if args.dpdk_revision_id:
-        args.dpdk_tarball_path = DPDKGitTarball(args.dpdk_revision_id, args.output_dir)
+        args.dpdk_tarball_path = Path(DPDKGitTarball(args.dpdk_revision_id, args.output_dir))
 
     args.test_suites = _process_test_suites(parser, args.test_suites)