#!/bin/sh
set -e

# This tests juju-quickstart non-interactively. Experience of past failures
# suggests that this is good enough to catch the issues we have hit so far -
# particularly in the area of API/ABI mismatches between juju-core,
# juju-quickstart, python-websocket, python-jujuclient and so forth.

# Author: Robie Basak <robie.basak@canonical.com>

if ! sudo -n true; then
	echo "This test requires passwordless sudo to be available." >&2
	echo "Test failed." >&2
	exit 1
fi

mkdir -pm700 ~/.ssh
ssh-keygen -N '' -f ~/.ssh/id_rsa
juju generate-config
juju switch local
juju-quickstart --no-browser
