1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh
set -e
# Setup the SSH directory
mkdir -p $HOME/.ssh
chmod 0700 $HOME/.ssh
# Create an ssh key to ssh to localhost
ssh-keygen -N "" -f $HOME/.ssh/cumin_key
# Authorize the key for the current user
cat $HOME/.ssh/cumin_key.pub >> $HOME/.ssh/authorized_keys
# Create an ssh_config file for cumin
cat << EOF > "$AUTOPKGTEST_TMP/ssh_config"
Host localhost
ConnectTimeout 2
GlobalKnownHostsFile /dev/null
IdentitiesOnly yes
IdentityFile $HOME/.ssh/cumin_key
LogLevel ERROR
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
EOF
# Create a configuration file for cumin
cat > "$AUTOPKGTEST_TMP/config.yaml" << EOF
transport: clustershell
log_file: $AUTOPKGTEST_TMP/cumin.log
default_backend: direct
clustershell:
ssh_options:
- '-F $AUTOPKGTEST_TMP/ssh_config'
EOF
# Run a simple full cumin command against localhost
cumin --force --config "$AUTOPKGTEST_TMP/config.yaml" "localhost" "id"
|