5 # all below addresses are those of the qemu host
6 [ -z "$SELF_HOST" ] && SELF_HOST="selftest.$(hostname)"
7 [ -z "$SELF_IP" ] && SELF_IP="10.1.159.48"
10 ####################################################
14 yum -y install myplc-native
16 # make sure its stopped
19 # turn off plc until its been configured
22 ####################################################
23 # configure myplc for testing purposes
25 PW=$(od -N 16 -x /dev/urandom | head -1 | sed "s, ,,g")
27 echo "e PLC_ROOT_PASSWORD" >> $config
30 echo "e PLC_NAME" >> $config
31 echo "selftest" >> $config
33 echo "e PLC_ROOT_USER" >> $config
34 echo "root@localhost.localdomain" >> $config
36 echo "e PLC_MAIL_ENABLED" >> $config
39 echo "e PLC_MAIL_SUPPORT_ADDRESS" >> $config
40 echo "build@lists.planet-lab.org" >> $config
42 echo "e PLC_DB_HOST" >> $config
43 echo $SELF_HOST >> $config
45 echo "e PLC_API_HOST" >> $config
46 echo $SELF_HOST >> $config
48 echo "e PLC_WWW_HOST" >> $config
49 echo $SELF_HOST >> $config
51 echo "e PLC_BOOT_HOST" >> $config
52 echo $SELF_HOST >> $config
54 echo "e PLC_DB_IP" >> $config
55 echo $SELF_IP >> $config
57 echo "e PLC_API_IP" >> $config
58 echo $SELF_IP >> $config
60 echo "e PLC_WWW_IP" >> $config
61 echo $SELF_IP >> $config
63 echo "e PLC_BOOT_IP" >> $config
64 echo $SELF_IP >> $config
69 plc-config-tty < $config
71 echo "$PW" > /etc/planetlab/pw
72 chmod 400 /etc/planetlab/pw
79 ####################################################
84 # go no further than this for now
88 ####################################################
89 # configure a node @ the local myplc
91 # xxx execute plcsh with the appropriate set of commands to
97 # grab a bootcd image with the configuration file built in
100 # setup qemu to run the node from the bootcd
103 testdir=$(mktemp -d /var/tmp/selftest.XXXX)
105 qemu-img create -f qcow disk.img 5GB
107 if [ -f "$BOOTCDIMG" ] ; then
109 # -x for serial line console
110 # -m 512 (512MB memory)
112 qemu -x -m 512 -cdrom $BOOTCDIMG