summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkhilman <khilman@users.noreply.github.com>2018-02-05 09:43:59 -0800
committerGitHub <noreply@github.com>2018-02-05 09:43:59 -0800
commit8ebd1780f24f983907bf3d7d30b4306b67e0dae5 (patch)
treefb0075d07238fdc8c82963f3f46063f862d78761
parent55ab0db7581e910322b165198a461a30ff87c58d (diff)
parent17eb55c52985bb68ac7666ca1afa5b5f848b7b53 (diff)
Merge pull request #17 from montjoie/pdugeneric
Pdugeneric
-rw-r--r--lava-slave/Dockerfile5
-rwxr-xr-xlava-slave/scripts/start.sh11
-rwxr-xr-xlavalab-gen.py29
3 files changed, 12 insertions, 33 deletions
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile
index 8f7ba82..6f2181e 100644
--- a/lava-slave/Dockerfile
+++ b/lava-slave/Dockerfile
@@ -46,11 +46,6 @@ COPY configs/tftpd-hpa /etc/default/tftpd-hpa
COPY scripts/cu-loop /usr/local/bin/
COPY conmux/* /etc/conmux/
-#install pdudaemon
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y install postgresql
-RUN service postgresql start && DEBIAN_FRONTEND=noninteractive apt-get -y install lavapdu-daemon lavapdu-client && service postgresql stop
-COPY lavapdu.conf /etc/lavapdu/
-
# Caution to not use any port between the Linux dynamic port range: 32768-60999
RUN sed -i 's,XNBD_PORT_RANGE_MIN.*,XNBD_PORT_RANGE_MIN=61950,' /usr/lib/python2.7/dist-packages/lava_dispatcher/utils/constants.py
RUN sed -i 's,XNBD_PORT_RANGE_MAX.*,XNBD_PORT_RANGE_MAX=62000,' /usr/lib/python2.7/dist-packages/lava_dispatcher/utils/constants.py
diff --git a/lava-slave/scripts/start.sh b/lava-slave/scripts/start.sh
index c9645b3..dcbbcd7 100755
--- a/lava-slave/scripts/start.sh
+++ b/lava-slave/scripts/start.sh
@@ -10,17 +10,6 @@ service tftpd-hpa start || exit 4
rm -f /var/run/lava-slave.pid
service lava-slave start || exit 5
-if [ -e /etc/lavapdu ];then
- /etc/init.d/postgresql start || exit 6
-
- echo "== Start lavapdu listen =="
- /etc/init.d/lavapdu-listen start || exit 7
- # lava listen create the database, let it some time
- sleep 5
- echo "== Start lavapdu runner =="
- /etc/init.d/lavapdu-runner start || exit 8
-fi
-
touch /var/run/conmux-registry
/usr/sbin/conmux-registry 63000 /var/run/conmux-registry&
sleep 2
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 6a5ea43..0e0b583 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -19,10 +19,6 @@ template_conmux = string.Template("""#
#
listener ${board}
application console '${board} console' 'exec sg dialout "cu-loop /dev/${board} ${baud}"'
-command 'hardreset' 'Reboot ${board}' 'pduclient --daemon ${daemon} --host ${host} --port ${port} --command reboot ${delay} '
-command 'b' 'Reboot ${board}' 'pduclient --daemon ${daemon} --host ${host} --port ${port} --command reboot '
-command 'off' 'Power off ${board}' 'pduclient --daemon ${daemon} --host ${host} --port ${port} --command off '
-command 'on' 'Power on ${board}' 'pduclient --daemon ${daemon} --host ${host} --port ${port} --command on '
""")
#no comment it is volontary
@@ -32,10 +28,10 @@ template_device = string.Template("""{% extends '${devicetype}.jinja2' %}
template_device_conmux = string.Template("""
{% set connection_command = 'conmux-console ${board}' %}
""")
-template_device_pdu = string.Template("""
-{% set hard_reset_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=reboot' %}
-{% set power_off_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=off' %}
-{% set power_on_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=on' %}
+template_device_pdu_generic = string.Template("""
+{% set hard_reset_command = '${hard_reset_command}' %}
+{% set power_off_command = '${power_off_command}' %}
+{% set power_on_command = '${power_on_command}' %}
""")
template_udev = string.Template("""#
@@ -72,17 +68,16 @@ def main(args):
if b.get("disabled", None):
continue
- if b.has_key("pdu"):
- daemon = b["pdu"]["daemon"]
- host = b["pdu"]["host"]
- port = b["pdu"]["port"]
- devicetype = b["type"]
- delay_opt = ""
- device_line = template_device.substitute(board=board_name, port=port, devicetype=devicetype)
- device_line += template_device_pdu.substitute(port=port)
+ devicetype = b["type"]
+ device_line = template_device.substitute(devicetype=devicetype)
+ if b.has_key("pdu_generic"):
+ hard_reset_command = b["pdu_generic"]["hard_reset_command"]
+ power_off_command = b["pdu_generic"]["power_off_command"]
+ power_on_command = b["pdu_generic"]["power_on_command"]
+ device_line += template_device_pdu_generic.substitute(hard_reset_command=hard_reset_command, power_off_command=power_off_command, power_on_command=power_on_command)
if b.has_key("uart"):
baud = b["uart"].get("baud", baud_default)
- line = template_conmux.substitute(board=board_name, baud=baud, daemon=daemon, host=host, port=port, delay=delay_opt)
+ line = template_conmux.substitute(board=board_name, baud=baud)
serial = b["uart"]["serial"]
udev_line += template_udev.substitute(board=board_name, serial=serial)
dc_devices.append("/dev/%s:/dev/%s" % (board_name, board_name))