Skip to content

Commit 2024f09

Browse files
committed
Add fakeipmi container for test purpose
Use a fake IPMI server container instead of relying on this feature to be in the container during the tests.
1 parent d27abe4 commit 2024f09

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

.github/workflows/build_containers.yml

+31
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,34 @@ jobs:
252252
push: true
253253
tags: ${{ steps.meta.outputs.tags }}
254254
labels: ${{ steps.meta.outputs.labels }}
255+
256+
build-and-push-fakeipmi-image:
257+
runs-on: ubuntu-latest
258+
permissions:
259+
contents: read
260+
packages: write
261+
262+
steps:
263+
- name: Checkout repository
264+
uses: actions/checkout@v4
265+
266+
- name: Log in to the Container registry
267+
uses: docker/login-action@v3
268+
with:
269+
registry: ${{ env.REGISTRY }}
270+
username: ${{ github.actor }}
271+
password: ${{ secrets.GITHUB_TOKEN }}
272+
273+
- name: Extract metadata (tags, labels) for Docker
274+
id: meta
275+
uses: docker/metadata-action@v5
276+
with:
277+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ci-fakeipmi
278+
279+
- name: Build and push Docker image
280+
uses: docker/build-push-action@v5
281+
with:
282+
context: ./testsuite/dockerfiles/fakeipmi/
283+
push: true
284+
tags: ${{ steps.meta.outputs.tags }}
285+
labels: ${{ steps.meta.outputs.labels }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM opensuse/leap:15.6
2+
3+
RUN zypper -n in OpenIPMI && \
4+
mkdir -p /etc/ipmi
5+
6+
COPY ipmisim1.emu lan.conf fake_ipmi_host.sh /etc/ipmi
7+
8+
CMD ["ipmi_sim", "-n"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /bin/bash
2+
3+
echo
4+
echo "#### Fake IPM host started ####"
5+
echo
6+
7+
while true; do
8+
sleep 5
9+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Minimalistic simulation setup for ipmi_sim.
2+
3+
# The BMC is the MC at address 20
4+
mc_setbmc 0x20
5+
6+
# Now add the BMC
7+
mc_add 0x20 0 no-device-sdrs 0x23 9 8 0x9f 0x1291 0xf02 persist_sdr
8+
sel_enable 0x20 1000 0x0a
9+
10+
# Watchdog sensor. This must be sensor zero.
11+
sensor_add 0x20 0 0 35 0x6f event-only
12+
sensor_set_event_support 0x20 0 0 enable scanning per-state \
13+
000000000001111 000000000000000 \
14+
000000000001111 000000000000000
15+
16+
# Turn on the BMC
17+
mc_enable 0x20
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name "ipmisim1"
2+
3+
set_working_mc 0x20
4+
5+
# Define a LAN channel on channel 1
6+
startlan 1
7+
addr :: 623
8+
priv_limit admin
9+
10+
allowed_auths_callback none md2 md5 straight
11+
allowed_auths_user none md2 md5 straight
12+
allowed_auths_operator none md2 md5 straight
13+
allowed_auths_admin none md2 md5 straight
14+
15+
guid a123456789abcdefa123456789abcdef
16+
endlan
17+
18+
serial 15 :: 9002 codec VM
19+
20+
startcmd "/etc/ipmi/fake_ipmi_host.sh"
21+
startnow false
22+
23+
user 1 true "admin" "admin" user 10 none md2 md5 straight
24+
user 2 true "ipmiusr" "test" admin 10 none md2 md5 straight
25+

0 commit comments

Comments
 (0)