-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
- Loading branch information
Showing
4 changed files
with
80 additions
and
1 deletion.
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
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,45 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 1 ]; then | ||
echo $0: usage: sftp-log-it-test.sh camel-version | ||
exit 1 | ||
fi | ||
|
||
camel_version=$1 | ||
|
||
docker pull emberstack/sftp | ||
docker run -p 24:22 --name sftp -d emberstack/sftp | ||
sftpid=`docker ps -aqf "name=sftp"` | ||
|
||
echo $sftpid | ||
|
||
jbang run -Dcamel.jbang.version=$camel_version camel@apache/camel run --local-kamelet-dir=../../../../kamelets/ sftp-log.yaml & | ||
|
||
sleep 10 | ||
|
||
docker exec -it $sftpid bash -c "echo 'Ciao' >> /home/demo/sftp/demos/file1.txt" | ||
docker exec -it $sftpid bash -c "echo 'Ciao' >> /home/demo/sftp/demos/file2.txt" | ||
docker exec -it $sftpid bash -c "echo 'Ciao' >> /home/demo/sftp/demos/file3.txt" | ||
docker exec -it $sftpid bash -c "echo 'Ciao' >> /home/demo/sftp/demos/file4.txt" | ||
docker exec -it $sftpid bash -c "echo 'Ciao' >> /home/demo/sftp/demos/file5.txt" | ||
|
||
sleep 10 | ||
|
||
variable=`jbang run -Dcamel.jbang.version=$camel_version camel@apache/camel get | tail -n +2` | ||
success=`echo $variable | cut -d' ' -f11` | ||
fail=`echo $variable | cut -d' ' -f12` | ||
if [[ $success == 5 && $fail == 0 ]] | ||
then | ||
mkdir -p ../../../tests/ | ||
echo "Test Successful" > ../../../tests/sftp-log-it-test.result; | ||
else | ||
mkdir -p ../../../tests/ | ||
echo "Test failed" > ../../../tests/sftp-log-it-test.result; | ||
fi | ||
|
||
jbang run -Dcamel.jbang.version=$camel_version camel@apache/camel stop sftp-log | ||
|
||
docker stop sftp | ||
docker rm sftp | ||
|
||
cat ../../../tests/sftp-log-it-test.result |
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,32 @@ | ||
## --------------------------------------------------------------------------- | ||
## 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. | ||
## --------------------------------------------------------------------------- | ||
|
||
- route: | ||
from: | ||
uri: "kamelet:sftp-source" | ||
parameters: | ||
username: demo | ||
password: demo | ||
connectionHost: localhost | ||
connectionPort: 24 | ||
directoryName: demos/ | ||
recursive: true | ||
steps: | ||
- to: | ||
uri: "kamelet:log-sink" | ||
parameters: | ||
showStreams: false |
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