This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 6fbdcf294 ci: add a new test case for the disk is full (#3079)
6fbdcf294 is described below
commit 6fbdcf294c6998411c27bc0cf5e3181c3b9d9660
Author: sunheyi <[email protected]>
AuthorDate: Fri Oct 13 15:51:20 2023 +0800
ci: add a new test case for the disk is full (#3079)
* Add a new test case for the disk is full
* Revert "Add a new test case for the disk is full"
This reverts commit e79d89c4bf4ce8c2b8d0f6a3e74efa0306af5e06.
* Add a new test case for the disk is full# github action
* add rust test code
* add ASF License
* add ASF License
---
.github/workflows/fs_write_full_disk.yml | 52 +++++++++++++++++++++++++++++
core/tests/behavior/file_write_full_disk.rs | 25 ++++++++++++++
core/tests/behavior/main.rs | 1 +
3 files changed, 78 insertions(+)
diff --git a/.github/workflows/fs_write_full_disk.yml
b/.github/workflows/fs_write_full_disk.yml
new file mode 100644
index 000000000..862657d49
--- /dev/null
+++ b/.github/workflows/fs_write_full_disk.yml
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Fs write full disk
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Create disk image
+ run: |
+ fallocate -l 512K disk.img
+ mkfs disk.img
+
+ - name: Mount disk image
+ run: |
+ mkdir ./td
+ sudo mount -o loop disk.img ./td
+
+ - name: Set permissions
+ run: chmod a+wr ./td
+
+ # Add more steps for testing as needed
+
+ - name: Clean up
+ run: |
+ sudo umount ./td
+ rm -rf ./td
+ rm disk.img
diff --git a/core/tests/behavior/file_write_full_disk.rs
b/core/tests/behavior/file_write_full_disk.rs
new file mode 100644
index 000000000..0198af25a
--- /dev/null
+++ b/core/tests/behavior/file_write_full_disk.rs
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#[cfg(test)]
+mod tests {
+ #[tokio::test]
+ async fn test_file_write_on_full_disk() {
+ let data = [96u8; 1024 * 512]; // The writable was smaller than 512KB
+ op.write("/test", data.to_vec()).await.unwrap();
+ }
+}
diff --git a/core/tests/behavior/main.rs b/core/tests/behavior/main.rs
index 12f24e25f..de38efd14 100644
--- a/core/tests/behavior/main.rs
+++ b/core/tests/behavior/main.rs
@@ -48,6 +48,7 @@ mod blocking_list;
mod blocking_read_only;
mod blocking_rename;
mod blocking_write;
+mod file_write_full_disk;
use blocking_append::behavior_blocking_append_tests;
use blocking_copy::behavior_blocking_copy_tests;