-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(services/sftp): migrate to test planner (#3412)
* refactor(services/sftp): migrate to test planner Signed-off-by: suyanhanx <[email protected]> * polish job name Signed-off-by: suyanhanx <[email protected]> --------- Signed-off-by: suyanhanx <[email protected]>
- Loading branch information
Showing
3 changed files
with
90 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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: sftp | ||
description: 'Behavior test for SFTP' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup sftp | ||
shell: bash | ||
run: | | ||
mkdir -p target/ssh | ||
ssh-keygen -t rsa -b 4096 -f target/ssh/id_rsa -q -N "" < /dev/null | ||
docker run \ | ||
-v `pwd`/target/ssh/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro \ | ||
--ulimit nofile=65536:65536 \ | ||
-p 2222:22 -d atmoz/sftp \ | ||
foo::::upload | ||
- name: Setup | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_SFTP_ENDPOINT=ssh://127.0.0.1:2222 | ||
OPENDAL_SFTP_ROOT=/upload/sftp_test/ | ||
OPENDAL_SFTP_USER=foo | ||
OPENDAL_SFTP_KEY=${{ github.workspace }}/target/ssh/id_rsa | ||
OPENDAL_SFTP_KNOWN_HOSTS_STRATEGY=accept | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 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: sftp_with_default_root | ||
description: 'Behavior test for SFTP with default root' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup sftp | ||
shell: bash | ||
run: | | ||
mkdir -p target/ssh | ||
ssh-keygen -t rsa -b 4096 -f target/ssh/id_rsa -q -N "" < /dev/null | ||
tmpScript="$(mktemp)" | ||
echo "sed -i -e 's#ForceCommand internal-sftp#ForceCommand internal-sftp -d /upload#' /etc/ssh/sshd_config" > "$tmpScript" | ||
chmod +x "$tmpScript" | ||
docker run \ | ||
-v "$tmpScript:/etc/sftp.d/change_root_dir" \ | ||
-v `pwd`/target/ssh/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro \ | ||
--ulimit nofile=65536:65536 \ | ||
-p 2222:22 -d atmoz/sftp \ | ||
foo::::upload | ||
- name: Setup | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_SFTP_ENDPOINT=ssh://127.0.0.1:2222 | ||
OPENDAL_SFTP_USER=foo | ||
OPENDAL_SFTP_KEY=${{ github.workspace }}/target/ssh/id_rsa | ||
OPENDAL_SFTP_KNOWN_HOSTS_STRATEGY=accept | ||
OPENDAL_DISABLE_RANDOM_ROOT=true | ||
EOF |
This file was deleted.
Oops, something went wrong.