- 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
This commit is contained in:
Uggla 2016-05-28 15:43:14 +02:00
parent 13f0974cae
commit 68f70626ad
3 changed files with 18 additions and 2 deletions

View File

@ -5,9 +5,10 @@ MAINTAINER bruno.cornec@hpe.com
ENV DEBIAN_FRONTEND noninterative ENV DEBIAN_FRONTEND noninterative
# Install deps for Redfish mockup # Install deps for Redfish mockup
RUN apt-get update RUN apt-get update
RUN apt-get -y install apache2 unzip sed RUN apt-get -y install apache2 unzip sed patch vim
EXPOSE 80 EXPOSE 80
COPY redfish-setup.sh /tmp/redfish-setup.sh COPY redfish-setup.sh /tmp/redfish-setup.sh
COPY DSP2043_0.99.0a.zip /tmp/DSP2043_0.99.0a.zip COPY DSP2043_0.99.0a.zip /tmp/DSP2043_0.99.0a.zip
COPY fix_manager_ei.patch /tmp/fix_manager_ei.patch
RUN chmod 755 /tmp/redfish-setup.sh RUN chmod 755 /tmp/redfish-setup.sh
CMD /tmp/redfish-setup.sh CMD /tmp/redfish-setup.sh

11
dmtf/fix_manager_ei.patch Normal file
View File

@ -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"
},

View File

@ -16,6 +16,7 @@ trap stop_apache HUP INT QUIT KILL TERM
# Main # Main
[ -f /run/apache2/apache2.pid ] && rm -rf /run/apache2/apache2.pid # Avoid pb to restart container if brutally killed
cd /var/www/html cd /var/www/html
unzip -q -o /tmp/DSP2043_0.99.0a.zip unzip -q -o /tmp/DSP2043_0.99.0a.zip
chmod 755 DSP2043_0.99.0a chmod 755 DSP2043_0.99.0a
@ -23,6 +24,9 @@ ln -sf DSP2043_0.99.0a redfish
cd redfish cd redfish
ln -sf . v1 ln -sf . v1
cd .. cd ..
# Patch simulator to fix incorrect json
cd /
patch -p0 < /tmp/fix_manager_ei.patch
ip a ip a
#sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf #sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf
start_apache start_apache