From 68f70626ad2b2de1910d69ff9c05346a1e87efd6 Mon Sep 17 00:00:00 2001 From: Uggla Date: Sat, 28 May 2016 15:43:14 +0200 Subject: [PATCH] Fix mockup invalid json into http://localhost:8000/redfish/v1/Managers/1/EthernetInterfaces/1 - Update container creation process to patch the mockup. - Also remove apache pid file if present. Happens if container is brutally killed. - This is a fix for the old mockup 0.99a waiting to create a new process and container to use the 1.0. Change-Id: I1be50a77b514d01e119be128b63a55180d2fa3fd --- dmtf/Dockerfile | 5 +++-- dmtf/fix_manager_ei.patch | 11 +++++++++++ dmtf/redfish-setup.sh | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 dmtf/fix_manager_ei.patch diff --git a/dmtf/Dockerfile b/dmtf/Dockerfile index f44de54..445e074 100644 --- a/dmtf/Dockerfile +++ b/dmtf/Dockerfile @@ -5,9 +5,10 @@ MAINTAINER bruno.cornec@hpe.com ENV DEBIAN_FRONTEND noninterative # Install deps for Redfish mockup RUN apt-get update -RUN apt-get -y install apache2 unzip sed +RUN apt-get -y install apache2 unzip sed patch vim EXPOSE 80 COPY redfish-setup.sh /tmp/redfish-setup.sh COPY DSP2043_0.99.0a.zip /tmp/DSP2043_0.99.0a.zip -RUN chmod 755 /tmp/redfish-setup.sh +COPY fix_manager_ei.patch /tmp/fix_manager_ei.patch +RUN chmod 755 /tmp/redfish-setup.sh CMD /tmp/redfish-setup.sh diff --git a/dmtf/fix_manager_ei.patch b/dmtf/fix_manager_ei.patch new file mode 100644 index 0000000..4ec3d34 --- /dev/null +++ b/dmtf/fix_manager_ei.patch @@ -0,0 +1,11 @@ +--- /var/www/html/redfish/Managers/1/EthernetInterfaces/1/index.html 2016-05-28 13:09:32.028645250 +0000 ++++ /var/www/html/redfish/Managers/1/EthernetInterfaces/1/index.html.patched 2016-05-28 13:21:19.826186341 +0000 +@@ -67,7 +67,7 @@ + ] + }, + "@Redfish.Settings": { +- "@odata.type": "#Settings.1.0.0.Settings" ++ "@odata.type": "#Settings.1.0.0.Settings", + "SettingsObject": { + "@odata.id": "/redfish/v1/Managers/1/EthernetInterfaces/1/SD" + }, diff --git a/dmtf/redfish-setup.sh b/dmtf/redfish-setup.sh index ba3f2dd..b412b5c 100644 --- a/dmtf/redfish-setup.sh +++ b/dmtf/redfish-setup.sh @@ -16,6 +16,7 @@ trap stop_apache HUP INT QUIT KILL TERM # Main +[ -f /run/apache2/apache2.pid ] && rm -rf /run/apache2/apache2.pid # Avoid pb to restart container if brutally killed cd /var/www/html unzip -q -o /tmp/DSP2043_0.99.0a.zip chmod 755 DSP2043_0.99.0a @@ -23,6 +24,9 @@ ln -sf DSP2043_0.99.0a redfish cd redfish ln -sf . v1 cd .. +# Patch simulator to fix incorrect json +cd / +patch -p0 < /tmp/fix_manager_ei.patch ip a #sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf start_apache