5 # all below addresses are those of the qemu host
6 [ -n "$SELF_HOST" ] && SELF_HOST="selftest.$(hostname)"
7 [ -n "$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 "selftest" >> $config
36 echo "e PLC_MAIL_ENABLED" >> $config
39 echo "e PLC_MAIL_SUPPORT_ADDRESS" >> $config
40 echo "mef@cs.princeton.edu" >> $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
66 echo "e PLC_NET_DNS1" >> $config
67 echo $SELF_IP >> $config
69 echo "e PLC_NET_DNS2" >> $config
70 echo $SELF_IP >> $config
75 plc-config-tty < $config
77 echo "$PW" > /etc/planetlab/pw
78 chmod 400 /etc/planetlab/pw
85 ####################################################
90 # go no further than this for now
94 ####################################################
95 # configure a node @ the local myplc
97 # xxx execute plcsh with the appropriate set of commands to
103 # grab a bootcd image with the configuration file built in
106 # setup qemu to run the node from the bootcd
109 testdir=$(mktemp -d /var/tmp/selftest.XXXX)
111 qemu-img create -f qcow disk.img 5GB
113 if [ -f "$BOOTCDIMG" ] ; then
115 # -x for serial line console
116 # -m 512 (512MB memory)
118 qemu -x -m 512 -cdrom $BOOTCDIMG