Skip to content

Commit

Permalink
Merge pull request #764 from addiva-elektronik/update-infix-test
Browse files Browse the repository at this point in the history
Simplify Running Infix Tests from External Projects
  • Loading branch information
axkar authored Oct 25, 2024
2 parents 04c843e + 3b2bdbf commit 55a20bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 6 additions & 2 deletions test/env
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ start_topology()
done

base_img=$(get_base_img "$files")
$testdir/inject-test-mode -b "$base_img" -o "${base_img%-disk.img}-disk-test.img"
test_img="${base_img%-disk.img}-disk-test.img"

$testdir/inject-test-mode -b "$base_img" -o "$test_img"

img_name=$(basename "$test_img")
sed -i "s/qn_image=\".*\"/qn_image=\"$img_name\"/" "$envdir/qeneth/topology.dot.in"

(cd "$envdir/qeneth/" && $qeneth generate && $qeneth start)
INFAMY_ARGS="$INFAMY_ARGS $envdir/qeneth/topology.dot"

cat <<EOF >"$envdir/bin/qeneth"
#!/bin/sh
set -x
cd $envdir/qeneth && exec $testdir/qeneth/qeneth "\$@"
EOF
chmod +x "$envdir/bin/qeneth"
Expand Down
8 changes: 3 additions & 5 deletions test/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ GIT_PATH = $(BR2_EXTERNAL_INFIX_PATH)
endif
GIT_VERSION = $(shell git -C $(GIT_PATH) describe --dirty --always --tags)

IMAGE ?= infix
TOPOLOGY-DIR ?= $(test-dir)/virt/quad

base := -b $(base-dir)

TEST_MODE ?= qeneth
mode-qeneth := -q $(TOPOLOGY-DIR)
mode-qeneth := -q $(test-dir)/virt/quad
mode-host := -t $(or $(TOPOLOGY),/etc/infamy.dot)
mode-run := -t $(BINARIES_DIR)/qemu.dot
mode := $(mode-$(TEST_MODE))

binaries-$(ARCH) := $(addprefix $(IMAGE)-$(ARCH),.img -disk.img .pkg)
INFIX_IMAGE_ID := $(call qstrip,$(INFIX_IMAGE_ID))
binaries-$(ARCH) := $(addprefix $(INFIX_IMAGE_ID),.img -disk.img .pkg)
binaries-x86_64 += OVMF.fd
binaries := $(foreach bin,$(binaries-$(ARCH)),-f $(BINARIES_DIR)/$(bin))

Expand Down

0 comments on commit 55a20bb

Please sign in to comment.