Skip to content

Commit

Permalink
ci: Migrate ftp to test planner (#3843)
Browse files Browse the repository at this point in the history
* ci: Migrate ftp to test planner

Signed-off-by: Xuanwo <[email protected]>

* Don't reuse conn

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Dec 28, 2023
1 parent 8d4d8cc commit 0aee13f
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 93 deletions.
36 changes: 36 additions & 0 deletions .github/services/ftp/vsftpd/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: vsftpd
description: 'Behavior test for vsftpd'

runs:
using: "composite"
steps:
- name: Setup vsftpd cluster
shell: bash
working-directory: fixtures/ftp
run: docker compose -f docker-compose-vsftpd.yml up -d --wait
- name: Setup
shell: bash
run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_FTP_ENDPOINT=ftp://127.0.0.1:2121
OPENDAL_FTP_ROOT=/
OPENDAL_FTP_USER=admin
OPENDAL_FTP_PASSWORD=admin
EOF
91 changes: 0 additions & 91 deletions .github/workflows/service_test_ftp.yml

This file was deleted.

6 changes: 4 additions & 2 deletions core/src/services/ftp/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,11 @@ impl bb8::ManageConnection for Manager {
conn.noop().await
}

/// Always allow reuse conn.
/// Don't allow reuse conn.
///
/// We need to investigate why reuse conn will cause error.
fn has_broken(&self, _: &mut Self::Connection) -> bool {
false
true
}
}

Expand Down
35 changes: 35 additions & 0 deletions fixtures/ftp/docker-compose-vsftpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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.

version: "3.8"
services:
vsftpd:
image: fauria/vsftpd
ports:
- "2121:21"
- "20000-22000:20000-22000"
environment:
FTP_USER: admin
FTP_PASS: admin
PASV_ADDRESS: 127.0.0.1
PASV_MIN_PORT: 20000
PASV_MAX_PORT: 22000
volumes:
- vsftpd-data:/home/vsftpd

volumes:
vsftpd-data:

0 comments on commit 0aee13f

Please sign in to comment.