From fcaacd539798da02954a2da1569821b2e59ecb53 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 30 Aug 2025 16:37:46 +0900 Subject: [PATCH] Remove ut_test.py (#2722) pjdfstest supersedes this. --- .github/workflows/ci.yml | 1 + .github/workflows/linux-ci-helper.sh | 8 -- test/integration-test-main.sh | 9 -- test/ut_test.py | 126 --------------------------- 4 files changed, 1 insertion(+), 143 deletions(-) delete mode 100755 test/ut_test.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cf7ee1..46315d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -264,6 +264,7 @@ jobs: - name: Install packages run: | .github/workflows/linux-ci-helper.sh fedora:42 + dnf install -y python3 - name: Install extra packages run: | diff --git a/.github/workflows/linux-ci-helper.sh b/.github/workflows/linux-ci-helper.sh index d006c4b..9b46b8b 100755 --- a/.github/workflows/linux-ci-helper.sh +++ b/.github/workflows/linux-ci-helper.sh @@ -102,7 +102,6 @@ if [ "${CONTAINER_FULLNAME}" = "ubuntu:25.04" ] || mailcap openjdk-21-jre-headless pkg-config - python3 ) elif [ "${CONTAINER_FULLNAME}" = "ubuntu:22.04" ]; then @@ -129,7 +128,6 @@ elif [ "${CONTAINER_FULLNAME}" = "ubuntu:22.04" ]; then mime-support openjdk-21-jre-headless pkg-config - python3 ) CURL_DIRECT_INSTALL=1 @@ -159,7 +157,6 @@ elif [ "${CONTAINER_FULLNAME}" = "debian:trixie" ]; then openjdk-21-jre-headless pkg-config procps - python3 ) elif [ "${CONTAINER_FULLNAME}" = "debian:bookworm" ] || @@ -188,7 +185,6 @@ elif [ "${CONTAINER_FULLNAME}" = "debian:bookworm" ] || openjdk-17-jre-headless pkg-config procps - python3 ) CURL_DIRECT_INSTALL=1 @@ -227,7 +223,6 @@ elif [ "${CONTAINER_FULLNAME}" = "rockylinux/rockylinux:10" ]; then openssl-devel perl-Test-Harness procps - python3 xz https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm ) @@ -266,7 +261,6 @@ elif [ "${CONTAINER_FULLNAME}" = "rockylinux:9" ]; then openssl-devel perl-Test-Harness procps - python3 xz https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm ) @@ -299,7 +293,6 @@ elif [ "${CONTAINER_FULLNAME}" = "rockylinux:8" ]; then openssl openssl-devel perl-Test-Harness - python3 ) CURL_DIRECT_INSTALL=1 @@ -386,7 +379,6 @@ elif [ "${CONTAINER_FULLNAME}" = "alpine:3.22" ]; then openssl perl-test-harness-utils procps - python3 sed ) diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index 7409db9..71ce023 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -2439,14 +2439,6 @@ function test_not_existed_dir_obj() { rm -rf not_existed_dir_parent } -function test_ut_ossfs { - describe "Testing ossfs python ut..." - - # shellcheck disable=SC2153 - export TEST_BUCKET_MOUNT_POINT="${TEST_BUCKET_MOUNT_POINT_1}" - ../../ut_test.py -} - function test_cr_filename { describe "Testing filename with CR code ..." @@ -2933,7 +2925,6 @@ function add_all_tests { if ! test -f /etc/os-release || ! grep -q -i -e 'ID=alpine' -e 'ID="alpine"' /etc/os-release; then add_tests test_not_existed_dir_obj fi - add_tests test_ut_ossfs add_tests test_cr_filename if ! s3fs_args | grep -q ensure_diskfree && ! uname | grep -q Darwin; then add_tests test_ensurespace_move_file diff --git a/test/ut_test.py b/test/ut_test.py deleted file mode 100755 index fa9577c..0000000 --- a/test/ut_test.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python3 -# -# s3fs - FUSE-based file system backed by Amazon S3 -# -# Copyright 2007-2008 Randy Rizun -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -import os -import unittest -import random -import sys -import time - -class OssfsUnitTest(unittest.TestCase): - def setUp(self): - pass - - def tearDown(self): - pass - - def random_string(self, len): - char_set = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g'] - list = [] - for i in range(0, len): - list.append(random.choice(char_set)) - return "".join(list) - - def test_read_file(self): - filename = "%s" % (self.random_string(10)) - print(filename) - - f = open(filename, 'w') - data = self.random_string(1000) - f.write(data) - f.close() - - f = open(filename, 'r') - data = f.read(100) - self.assertEqual(len(data), 100) - data = f.read(100) - self.assertEqual(len(data), 100) - f.close() - - os.remove(filename) - - def test_rename_file(self): - filename1 = "%s" % (self.random_string(10)) - filename2 = "%s" % (self.random_string(10)) - print(filename1, filename2) - - f = open(filename1, 'w+') - data1 = self.random_string(1000) - f.write(data1) - - os.rename(filename1, filename2) - - f.seek(0, 0) - data2 = f.read() - f.close() - - self.assertEqual(len(data1), len(data2)) - self.assertEqual(data1, data2) - - os.remove(filename2) - - def test_rename_file2(self): - filename1 = "%s" % (self.random_string(10)) - filename2 = "%s" % (self.random_string(10)) - print(filename1, filename2) - - f = open(filename1, 'w') - data1 = self.random_string(1000) - f.write(data1) - f.close() - - os.rename(filename1, filename2) - - f = open(filename2, 'r') - f.seek(0, 0) - data2 = f.read() - f.close() - - self.assertEqual(len(data1), len(data2)) - self.assertEqual(data1, data2) - - os.remove(filename2) - - def test_truncate_open_file(self): - filename = "%s" % (self.random_string(10)) - fd = os.open(filename, os.O_CREAT|os.O_RDWR) - try: - os.write(fd, b'a' * 42) - self.assertEqual(os.fstat(fd).st_size, 42) - os.ftruncate(fd, 100) - self.assertEqual(os.fstat(fd).st_size, 100) - finally: - os.close(fd) - self.assertEqual(100, os.stat(filename).st_size) - - os.remove(filename) - -if __name__ == '__main__': - unittest.main() - -# -# Local variables: -# tab-width: 4 -# c-basic-offset: 4 -# End: -# vim600: expandtab sw=4 ts=4 fdm=marker -# vim<600: expandtab sw=4 ts=4 -#