platform_build_soong/tests/soong_test.sh
Rupert Shuttleworth 755ceb01e3 Ensure directories in the Soong output dir have appropriate permissions, so that 'm clean' works.
In particular, Bazel sometimes creates directories whose files cannot be deleted.

Test: m clean used to fail after b build //system/timezone/apex:com.android.tzdata, but now it works
Test: Added integration test which fails without this change

Change-Id: I08c8feed21c31ec187fe40be513f7eb4865c8ac3
2021-08-12 05:07:11 -04:00

22 lines
501 B
Bash
Executable file

#!/bin/bash -eu
set -o pipefail
# Tests of Soong functionality
source "$(dirname "$0")/lib.sh"
function test_m_clean_works {
setup
# Create a directory with files that cannot be removed
mkdir -p out/bad_directory_permissions
touch out/bad_directory_permissions/unremovable_file
# File permissions are fine but directory permissions are bad
chmod a+rwx out/bad_directory_permissions/unremovable_file
chmod a-rwx out/bad_directory_permissions
run_soong clean
}
test_m_clean_works