#!/bin/sh
set -efu

export HOME=$ADTTMP
cd $ADTTMP

if [ "$1" = "ipython" ]; then
IPYTHON=ipython
IRUNNER=irunner
IPCLUSTER=ipcluster
elif [ "$1" = "ipython3" ]; then
IPYTHON=ipython3
IRUNNER=irunner3
IPCLUSTER=ipcluster3
fi

$IPYTHON locate
$IPYTHON profile create 2>&1

$IPYTHON profile create foo_profile 2>&1
$IPYTHON profile list | grep foo_profile 2>&1

# "test" 701597, it won't fail but it can be seen by inspecting the logs
cat << EOF > test.py
from lxml import etree;
tree = etree.fromstring('<a></a>')
tree.find('/')
EOF

$IRUNNER test.py
$IRUNNER --ipython test.py

$IPCLUSTER --help
