From 17d0970244fd65227745accbb1a94663a0543b84 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Mon, 4 Nov 2024 15:11:19 +0000 Subject: [PATCH] Changed the macOS Github Actions runner image to macos-13 Changed the macos Github Actions runner image to macos-13, and avoided extended attribute error when copying with macos-fuse-t. --- .github/workflows/ci.yml | 4 ++-- test/integration-test-main.sh | 12 ++++++------ test/test-utils.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c98275..f21a368 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,8 +124,8 @@ jobs: # This job doesn't work with GitHub Actions using macOS 11+ because "load_osxfuse" returns # "exit code = 1".(requires OS reboot) # - macos12: - runs-on: macos-12 + macos-13: + runs-on: macos-13 steps: - name: Checkout source code diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index a6e6971..f6df6f7 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -654,7 +654,7 @@ function test_multipart_mix { # it makes no sense, but copying files is because it leaves no cache. # cp "${TEMP_DIR}/${BIG_FILE}" "${TEMP_DIR}/${BIG_FILE}-mix" - cp "${BIG_FILE}" "${BIG_FILE}-mix" + cp_avoid_xattr_err "${BIG_FILE}" "${BIG_FILE}-mix" local MODIFY_START_BLOCK=$((15*1024*1024/2/4)) echo -n "0123456789ABCDEF" | dd of="${BIG_FILE}-mix" bs=4 count=4 seek="${MODIFY_START_BLOCK}" conv=notrunc @@ -671,7 +671,7 @@ function test_multipart_mix { # modify directly(over file end offset) # cp "${TEMP_DIR}/${BIG_FILE}" "${TEMP_DIR}/${BIG_FILE}-mix" - cp "${BIG_FILE}" "${BIG_FILE}-mix" + cp_avoid_xattr_err "${BIG_FILE}" "${BIG_FILE}-mix" local OVER_FILE_BLOCK_POS=$((26*1024*1024/4)) echo -n "0123456789ABCDEF" | dd of="${BIG_FILE}-mix" bs=4 count=4 seek="${OVER_FILE_BLOCK_POS}" conv=notrunc @@ -687,7 +687,7 @@ function test_multipart_mix { # (3) Writing from the 0th byte # cp "${TEMP_DIR}/${BIG_FILE}" "${TEMP_DIR}/${BIG_FILE}-mix" - cp "${BIG_FILE}" "${BIG_FILE}-mix" + cp_avoid_xattr_err "${BIG_FILE}" "${BIG_FILE}-mix" echo -n "0123456789ABCDEF" | dd of="${BIG_FILE}-mix" bs=4 count=4 seek=0 conv=notrunc echo -n "0123456789ABCDEF" | dd of="${TEMP_DIR}/${BIG_FILE}-mix" bs=4 count=4 seek=0 conv=notrunc @@ -703,7 +703,7 @@ function test_multipart_mix { # modify directly(seek 1MB offset) # cp "${TEMP_DIR}/${BIG_FILE}" "${TEMP_DIR}/${BIG_FILE}-mix" - cp "${BIG_FILE}" "${BIG_FILE}-mix" + cp_avoid_xattr_err "${BIG_FILE}" "${BIG_FILE}-mix" local MODIFY_START_BLOCK=$((1*1024*1024)) echo -n "0123456789ABCDEF" | dd of="${BIG_FILE}-mix" bs=4 count=4 seek="${MODIFY_START_BLOCK}" conv=notrunc @@ -874,7 +874,7 @@ function test_mtime_file { mk_test_file #copy the test file with preserve mode - cp -p "${TEST_TEXT_FILE}" "${ALT_TEST_TEXT_FILE}" + cp_avoid_xattr_err -p "${TEST_TEXT_FILE}" "${ALT_TEST_TEXT_FILE}" local testmtime; testmtime=$(get_mtime "${TEST_TEXT_FILE}") local testctime; testctime=$(get_ctime "${TEST_TEXT_FILE}") @@ -1099,7 +1099,7 @@ function test_update_time_cp_p() { # cp -p -> update ctime, not update atime/mtime # local TIME_TEST_TEXT_FILE=test-s3fs-time.txt - cp -p "${TEST_TEXT_FILE}" "${TIME_TEST_TEXT_FILE}" + cp_avoid_xattr_err -p "${TEST_TEXT_FILE}" "${TIME_TEST_TEXT_FILE}" local atime; atime=$(get_atime "${TIME_TEST_TEXT_FILE}") local ctime; ctime=$(get_ctime "${TIME_TEST_TEXT_FILE}") local mtime; mtime=$(get_mtime "${TIME_TEST_TEXT_FILE}") diff --git a/test/test-utils.sh b/test/test-utils.sh index 93db55d..44cc336 100644 --- a/test/test-utils.sh +++ b/test/test-utils.sh @@ -434,6 +434,39 @@ function wait_ostype() { fi } +# +# Avoid extended attribute errors when copying on macos(fuse-t) +# +# [NOTE][FIXME] +# This avoids an error that occurs when copying (cp command) on macos +# (fuse-t) stating that extended attributes cannot be copied and the +# exit code becomes anything other than 0. +#Even if this error occurs, the copy itself is successful. +# +# This issue is currently(2024/11/7) still in the process of being +# fixed, so we will wait and see. +# This issue only occurred in the test_multipart_mix test with the +# nocopyapi option, but in macos-13 Github Actions, it occurs in +# some tests that use the use_xattr option. +# +function cp_avoid_xattr_err() { + if uname | grep -q Darwin; then + if ! cp "$@"; then + return $? + fi + else + local CP_RESULT=""; + if ! CP_RESULT=$(cp "$@" 2>&1); then + local CP_EXITCODE=$? + if ! echo "${CP_RESULT}" | grep -q -i "Result too large"; then + return "${CP_EXITCODE}" + fi + echo "[FIXME: MACOS] ${CP_RESULT}" + fi + fi + return 0 +} + # # Local variables: # tab-width: 4