net/: Add solana-install test to sanity (#4438)

* Add instance creation date to motd

* Setup localtime

* Add solana-install test
This commit is contained in:
Michael Vines
2019-05-26 11:17:07 -07:00
committed by GitHub
parent 942785b626
commit 471465a5f4
4 changed files with 44 additions and 6 deletions

View File

@ -522,20 +522,27 @@ create)
printNetworkInfo() {
cat <<EOF
========================================================================================
Network composition:
==[ Network composition ]===============================================================
Bootstrap leader = $bootstrapLeaderMachineType (GPU=$enableGpu)
Additional fullnodes = $additionalFullNodeCount x $fullNodeMachineType
Client(s) = $clientNodeCount x $clientMachineType
Blockstreamer = $blockstreamer
========================================================================================
EOF
}
printNetworkInfo
creationDate=$(date)
creationInfo() {
cat <<EOF
Instance running since: $creationDate
========================================================================================
EOF
}
declare startupScript="$netConfigDir"/instance-startup-script.sh
cat > "$startupScript" <<EOF
#!/usr/bin/env bash
@ -554,6 +561,7 @@ cat > /etc/motd <<EOM
$ until [[ -f /.instance-startup-complete ]]; do sleep 1; done
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$(creationInfo)
EOM
# Place the generated private key at /solana-id_ecdsa so it's retrievable by anybody
@ -579,6 +587,7 @@ $(
install-nodejs.sh \
install-redis.sh \
install-rsync.sh \
localtime.sh \
network-config.sh \
remove-docker-interface.sh \
@ -590,6 +599,7 @@ $(
cat > /etc/motd <<EOM
$(printNetworkInfo)
$(creationInfo)
EOM
touch /.instance-startup-complete

View File

@ -69,8 +69,9 @@ local|tar)
entrypointRsyncUrl="$entrypointIp:~/solana"
solana_gossip=solana-gossip
solana_ledger_tool=solana-ledger-tool
solana_install=solana-install
solana_keygen=solana-keygen
solana_ledger_tool=solana-ledger-tool
ledger=config-local/bootstrap-leader-ledger
client_id=config-local/client-id.json
@ -163,4 +164,21 @@ else
echo "Note: validator sanity disabled"
fi
if [[ -r update_manifest_keypair.json ]]; then
echo "--- $entrypointIp: solana-install test"
(
set -x
update_manifest_pubkey=$($solana_keygen pubkey update_manifest_keypair.json)
rm -rf install-data-dir
$solana_install init \
--no-modify-path \
--data-dir install-data-dir \
--url http://"$entrypointIp":8899 \
--pubkey "$update_manifest_pubkey"
$solana_install info
)
fi
echo --- Pass

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Rsync setup for Snap builds
# Rsync setup
#
set -ex

10
net/scripts/localtime.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Setup timezone
#
set -ex
[[ $(uname) = Linux ]] || exit 1
[[ $USER = root ]] || exit 1
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime