From f8d031fb184c1b3997fc5ae47206f9d5519f7934 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 14 Oct 2022 15:21:49 +0200 Subject: [PATCH] generate_*_tests.py: chdir to mbedtls root Do this in 2.28 just like it's done in the development branch, so that code and command line usage that works on one branch doesn't surprisingly fail on 2.28. Signed-off-by: Gilles Peskine --- scripts/mbedtls_dev/test_data_generation.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/mbedtls_dev/test_data_generation.py b/scripts/mbedtls_dev/test_data_generation.py index 993cd4bdf473..376046858bc4 100644 --- a/scripts/mbedtls_dev/test_data_generation.py +++ b/scripts/mbedtls_dev/test_data_generation.py @@ -29,6 +29,7 @@ from abc import ABCMeta, abstractmethod from typing import Callable, Dict, Iterable, Iterator, List, Type, TypeVar +from mbedtls_dev import build_tree from mbedtls_dev import test_case T = TypeVar('T') #pylint: disable=invalid-name @@ -182,6 +183,12 @@ def main(args, description: str, generator_class: Type[TestGenerator] = TestGene help='List available targets and exit') parser.add_argument('targets', nargs='*', metavar='TARGET', help='Target file to generate (default: all; "-": none)') + + # Change to the mbedtls root, to keep things simple. + # Note that if any command line options refer to paths, they need to + # be adjusted first. + build_tree.chdir_to_root() + options = parser.parse_args(args) generator = generator_class(options) if options.list: