Skip to content

Commit 17a6c5d

Browse files
Alexandru-Cezar Sardanalsrdn
authored andcommitted
tests: remove git safe dir helper
Remove the helper function that marks the `/firecracker` source dir as safe for git since the config was added to the development container. Having the helper here missed the use case where `cargo build` was called from `devtool build` causing version inconsistencies. Signed-off-by: Alexandru-Cezar Sardan <[email protected]>
1 parent 19c0df8 commit 17a6c5d

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

tests/framework/utils.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -531,30 +531,6 @@ def run_cmd_list_async(cmd_list):
531531
)
532532

533533

534-
def configure_git_safe_directory():
535-
"""
536-
Add the root firecracker git folder to safe.directory config.
537-
538-
Firecracker root git folder in the container is
539-
bind-mounted to a folder on the host which is mapped to a
540-
user that is different from the user which runs the integ tests.
541-
This difference in ownership is validated against by git.
542-
https://github.blog/2022-04-12-git-security-vulnerability-announced/
543-
:return: none
544-
"""
545-
# devtool script will set the working directory to FC_ROOT/tests.
546-
# We will need the parent for safe.directory configuration
547-
working_dir = Path(os.getcwd())
548-
549-
try:
550-
utils.run_cmd('git config --global '
551-
'--add safe.directory {}'.format(working_dir.parent))
552-
except ChildProcessError as error:
553-
raise Exception("Failure to set the safe.directory "
554-
"git config to [{}] required for gitlint tests"
555-
.format(working_dir.parent)) from error
556-
557-
558534
def run_cmd(cmd, ignore_return_code=False, no_shell=False, cwd=None):
559535
"""
560536
Run a command using the sync function that logs the output.

tests/integration_tests/functional/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ def test_api_version(test_microvm_with_api):
11861186
# Validate VM version post-boot is the same as pre-boot.
11871187
assert preboot_response.json() == postboot_response.json()
11881188

1189-
test_utils.configure_git_safe_directory()
11901189
# Check that the version is the same as `git describe --dirty`.
11911190
out = subprocess.check_output(['git', 'describe', '--dirty']).decode()
11921191

tests/integration_tests/style/test_gitlint.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def test_gitlint():
1515
os.environ['LC_ALL'] = 'C.UTF-8'
1616
os.environ['LANG'] = 'C.UTF-8'
1717

18-
utils.configure_git_safe_directory()
1918
try:
2019
utils.run_cmd('gitlint --commits origin/main..HEAD'
2120
' -C ../.gitlint'

0 commit comments

Comments
 (0)