public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 953eacf2db17e941a1e912586001ed51f9be7bc5 9313 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
 
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Tests makefile
#
# Copyright Red Hat
# Author: David Gibson <david@gibson.dropbear.id.au>

WGET = wget -c

DEBIAN_IMGS = debian-8.11.0-openstack-amd64.qcow2 \
	debian-9-nocloud-amd64-daily-20200210-166.qcow2 \
	debian-10-nocloud-amd64.qcow2 \
	debian-10-generic-arm64.qcow2 \
	debian-10-generic-ppc64el-20220911-1135.qcow2 \
	debian-11-nocloud-amd64.qcow2 \
	debian-11-generic-arm64.qcow2 \
	debian-11-generic-ppc64el.qcow2 \
	debian-sid-nocloud-amd64-daily.qcow2 \
	debian-sid-nocloud-arm64-daily.qcow2 \
	debian-sid-nocloud-ppc64el-daily.qcow2

FEDORA_IMGS = Fedora-Cloud-Base-26-1.5.x86_64.qcow2 \
	Fedora-Cloud-Base-27-1.6.x86_64.qcow2 \
	Fedora-Cloud-Base-28-1.1.x86_64.qcow2 \
	Fedora-Cloud-Base-28-1.1.aarch64.qcow2 \
	Fedora-Cloud-Base-29-1.2.x86_64.qcow2 \
	Fedora-Cloud-Base-29-1.2.aarch64.qcow2 \
	Fedora-Cloud-Base-30-1.2.x86_64.qcow2 \
	Fedora-Cloud-Base-30-1.2.aarch64.qcow2 \
	Fedora-Cloud-Base-31-1.9.x86_64.qcow2 \
	Fedora-Cloud-Base-31-1.9.aarch64.qcow2 \
	Fedora-Cloud-Base-32-1.6.x86_64.qcow2 \
	Fedora-Cloud-Base-32-1.6.aarch64.qcow2 \
	Fedora-Cloud-Base-33-1.2.x86_64.qcow2 \
	Fedora-Cloud-Base-33-1.2.aarch64.qcow2 \
	Fedora-Cloud-Base-34-1.2.x86_64.qcow2 \
	Fedora-Cloud-Base-34-1.2.aarch64.qcow2 \
	Fedora-Cloud-Base-35-1.2.x86_64.qcow2 \
	Fedora-Cloud-Base-35-1.2.aarch64.qcow2

OPENSUSE_IMGS = openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2 \
	openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2 \
	openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2 \
	openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz \
	openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz \
	openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2

UBUNTU_OLD_IMGS = trusty-server-cloudimg-amd64-disk1.img \
	trusty-server-cloudimg-i386-disk1.img \
	trusty-server-cloudimg-ppc64el-disk1.img
UBUNTU_NEW_IMGS = xenial-server-cloudimg-powerpc-disk1.img \
	jammy-server-cloudimg-s390x.img
UBUNTU_IMGS = $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS)

DOWNLOAD_ASSETS = mbuto \
	$(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS)
TESTDATA_ASSETS = small.bin big.bin medium.bin
LOCAL_ASSETS = mbuto.img mbuto.mem.img QEMU_EFI.fd \
	$(DEBIAN_IMGS:%=prepared-%) $(FEDORA_IMGS:%=prepared-%) \
	$(UBUNTU_NEW_IMGS:%=prepared-%) \
	nstool guest-key guest-key.pub \
	$(TESTDATA_ASSETS)

ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS)

CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99

assets: $(ASSETS)

mbuto:
	git clone git://mbuto.sh/mbuto

guest-key guest-key.pub:
	ssh-keygen -f guest-key -N ''

mbuto.img: passt.mbuto mbuto guest-key.pub $(TESTDATA_ASSETS)
	./mbuto/mbuto -p ./$< -c lz4 -f $@

mbuto.mem.img: passt.mem.mbuto mbuto ../passt.avx2
	./mbuto/mbuto -p ./$< -c lz4 -f $@

nstool: nstool.c
	$(CC) $(CFLAGS) -o $@ $^

QEMU_EFI.fd:
	./find-arm64-firmware.sh $@

prepared-%.qcow2: %.qcow2 ./prepare-distro-img.sh
	qemu-img create -f qcow2 -F qcow2 -b $< $@
	./prepare-distro-img.sh $@

prepared-%.img: %.img ./prepare-distro-img.sh
	qemu-img create -f qcow2 -F qcow2 -b $< $@
	./prepare-distro-img.sh $(IMGTYPE) $@

small.bin:
	dd if=/dev/urandom bs=2k count=1 of=$@

medium.bin:
	dd if=/dev/urandom bs=1k count=5 of=$@

big.bin:
	dd if=/dev/urandom bs=1M count=10 of=$@

check-legacy: assets
	./run

debug: assets
	DEBUG=1 ./run

clean-legacy:
	rm -f perf.js
	rm -f $(LOCAL_ASSETS)
	rm -rf test_logs
	rm -f prepared-*.qcow2 prepared-*.img

realclean: clean-legacy
	rm -rf $(DOWNLOAD_ASSETS)

# Debian downloads
debian-8.11.0-openstack-%.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/OpenStack/archive/8.11.0/debian-8.11.0-openstack-$*.qcow2

debian-9-nocloud-%-daily-20200210-166.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/stretch/daily/20200210-166/debian-9-nocloud-$*-daily-20200210-166.qcow2

debian-10-nocloud-%.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/latest/debian-10-nocloud-$*.qcow2

debian-10-generic-ppc64el-20220911-1135.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/20220911-1135/debian-10-generic-ppc64el-20220911-1135.qcow2

debian-10-generic-%.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-$*.qcow2

debian-11-nocloud-%.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-$*.qcow2

debian-11-generic-%.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-$*.qcow2

debian-sid-nocloud-%-daily.qcow2:
	$(WGET) -O $@ https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-nocloud-$*-daily.qcow2

# Fedora downloads
Fedora-Cloud-Base-26-1.5.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/CloudImages/$*/images/Fedora-Cloud-Base-26-1.5.$*.qcow2

Fedora-Cloud-Base-27-1.6.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/27/CloudImages/$*/images/Fedora-Cloud-Base-27-1.6.$*.qcow2

Fedora-Cloud-Base-28-1.1.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/28/Cloud/$*/images/Fedora-Cloud-Base-28-1.1.$*.qcow2

Fedora-Cloud-Base-29-1.2.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/29/Cloud/$*/images/Fedora-Cloud-Base-29-1.2.$*.qcow2

Fedora-Cloud-Base-30-1.2.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Cloud/$*/images/Fedora-Cloud-Base-30-1.2.$*.qcow2

Fedora-Cloud-Base-31-1.9.%.qcow2:
	$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Cloud/$*/images/Fedora-Cloud-Base-31-1.9.$*.qcow2

Fedora-Cloud-Base-32-1.6.%.qcow2:
	$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/32/Cloud/$*/images/Fedora-Cloud-Base-32-1.6.$*.qcow2

Fedora-Cloud-Base-33-1.2.%.qcow2:
	$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/33/Cloud/$*/images/Fedora-Cloud-Base-33-1.2.$*.qcow2

Fedora-Cloud-Base-34-1.2.%.qcow2:
	$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Cloud/$*/images/Fedora-Cloud-Base-34-1.2.$*.qcow2

Fedora-Cloud-Base-35-1.2.%.qcow2:
	$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/35/Cloud/$*/images/Fedora-Cloud-Base-35-1.2.$*.qcow2

# OpenSuSE downloads
openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2:
	$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.1/jeos/openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2

openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2:
	$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.2/appliances/openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2

openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2:
	$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2

openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz:
	$(WGET) -O $@ http://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz

openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz:
	$(WGET) -O $@ http://download.opensuse.org/ports/armv7hl/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz

openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2:
	$(WGET) -O $@ https://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2

# Ubuntu downloads
trusty-server-cloudimg-%-disk1.img:
	$(WGET) -O $@ https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-$*-disk1.img

xenial-server-cloudimg-powerpc-disk1.img:
	$(WGET) -O $@ https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-powerpc-disk1.img

jammy-server-cloudimg-s390x.img:
	$(WGET) -O $@ https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-s390x.img

#
# New style tests based on Avocado
#

PYTHON = python3
VENV = venv
PLUGIN = avocado_classless
PYPKGS = $(PLUGIN)/$(PLUGIN) $(wildcard $(PLUGIN)/*.py) \
	tasst $(shell find avocado -name '*.py')

# Put this back if/when the plugin becomes available in upstream/system avocado
#AVOCADO := $(shell which avocado)
ifeq ($(AVOCADO),)
AVOCADO := $(VENV)/bin/avocado
endif

$(VENV):
	$(PYTHON) -m venv $(VENV)
	$(VENV)/bin/pip install avocado-framework
	$(VENV)/bin/pip install flake8
	$(VENV)/bin/pip install pylint
	$(VENV)/bin/pip install -e ./$(PLUGIN)

.PHONY: avocado-assets
avocado-assets: nstool small.bin medium.bin big.bin

.PHONY: avocado
avocado: avocado-assets $(VENV)
	PYTHONPATH=. $(AVOCADO) run avocado

.PHONY: avocado-meta
avocado-meta: avocado-assets $(VENV)
	PYTHONPATH=. $(AVOCADO) run $(PLUGIN)/selftests.py tasst

flake8: $(VENV)
	$(VENV)/bin/flake8 $(PYPKGS)

# pylint suppressions:
#
# C0116 missing-function-docstring
#    We have a bunch of trivial functions for which docstrings would be overkill
# C0103 invalid-name
#    As well as complaining about bad formatting style, this complains
#    about short identifiers (< 3 characters?).  For many locals and
#    some methods, this is stupid.
pylint: $(VENV)
	$(VENV)/bin/pylint \
	        --disable=C0116 \
	        --disable=C0103 \
	    $(PYPKGS)

.PHONY: check
check: avocado check-legacy

.PHONY: clean
clean: clean-legacy
	$(RM) -r $(VENV)
	find -name *~ | xargs $(RM)
	find -name __pycache__ -or -name '*.egg-info' | xargs $(RM) -r

debug log:

solving 953eacf2 ...
found 953eacf2 in https://archives.passt.top/passt-dev/20230627025429.2209702-22-david@gibson.dropbear.id.au/
found da542d33 in https://archives.passt.top/passt-dev/20230627025429.2209702-16-david@gibson.dropbear.id.au/
found 58159c83 in https://archives.passt.top/passt-dev/20230627025429.2209702-13-david@gibson.dropbear.id.au/
found 0e641024 in https://archives.passt.top/passt-dev/20230627025429.2209702-11-david@gibson.dropbear.id.au/
found c06d63b6 in https://archives.passt.top/passt-dev/20230627025429.2209702-9-david@gibson.dropbear.id.au/
found fc8d3a6f in https://archives.passt.top/passt-dev/20230627025429.2209702-7-david@gibson.dropbear.id.au/
found 00b84856 in https://archives.passt.top/passt-dev/20230627025429.2209702-6-david@gibson.dropbear.id.au/
found 9b3af410 in https://archives.passt.top/passt-dev/20230627025429.2209702-5-david@gibson.dropbear.id.au/
found d4d0c1a3 in https://archives.passt.top/passt-dev/20230627025429.2209702-4-david@gibson.dropbear.id.au/
found 7b00bef4 in https://passt.top/passt
preparing index
index prepared:
100644 7b00bef4392697408a643cdb128832a3116b832c	test/Makefile

applying [1/9] https://archives.passt.top/passt-dev/20230627025429.2209702-4-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index 7b00bef4..d4d0c1a3 100644


applying [2/9] https://archives.passt.top/passt-dev/20230627025429.2209702-5-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index d4d0c1a3..9b3af410 100644


applying [3/9] https://archives.passt.top/passt-dev/20230627025429.2209702-6-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index 9b3af410..00b84856 100644


applying [4/9] https://archives.passt.top/passt-dev/20230627025429.2209702-7-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index 00b84856..fc8d3a6f 100644


applying [5/9] https://archives.passt.top/passt-dev/20230627025429.2209702-9-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index fc8d3a6f..c06d63b6 100644


applying [6/9] https://archives.passt.top/passt-dev/20230627025429.2209702-11-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index c06d63b6..0e641024 100644


applying [7/9] https://archives.passt.top/passt-dev/20230627025429.2209702-13-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index 0e641024..58159c83 100644


applying [8/9] https://archives.passt.top/passt-dev/20230627025429.2209702-16-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index 58159c83..da542d33 100644


applying [9/9] https://archives.passt.top/passt-dev/20230627025429.2209702-22-david@gibson.dropbear.id.au/
diff --git a/test/Makefile b/test/Makefile
index da542d33..953eacf2 100644

Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
7:124: trailing whitespace.
# 
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
Checking patch test/Makefile...
Applied patch test/Makefile cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 953eacf2db17e941a1e912586001ed51f9be7bc5	test/Makefile

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).