Skip to content

Commit

Permalink
chore: update extensions test
Browse files Browse the repository at this point in the history
Update extensions test to use strategic patches and use
`ExtensionServiceConfig` document.

Depends on: siderolabs/extensions#320

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Feb 15, 2024
1 parent 1366ce1 commit f8b4ee8
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 115 deletions.
6 changes: 3 additions & 3 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ local ExtensionsStep(with_e2e=true) =
extra_commands=[
// create a patch file to pass to the downstream build
// ignore nvidia extensions, testing nvidia extensions needs a machine with nvidia graphics card
'jq -R < _out/extensions-metadata | jq -s -f hack/test/extensions/extension-patch-filter.jq > _out/extensions-patch.json',
'cat _out/extensions-patch.json',
'jq -R < _out/extensions-metadata | jq -s -f hack/test/extensions/extension-patch-filter.jq | yq eval ".[] | split_doc" -P > _out/extensions-patch.yaml',
'cat _out/extensions-patch.yaml',
]
);

local e2e_extensions = Step('e2e-extensions', target='e2e-qemu', privileged=true, depends_on=[extensions_patch_manifest], environment={
QEMU_MEMORY_WORKERS: '4096',
WITH_CONFIG_PATCH_WORKER: '@_out/extensions-patch.json',
WITH_CONFIG_PATCH_WORKER: '@_out/extensions-patch.yaml',
IMAGE_REGISTRY: local_registry,
QEMU_EXTRA_DISKS: '3',
SHORT_INTEGRATION_TEST: 'yes',
Expand Down
219 changes: 107 additions & 112 deletions hack/test/extensions/extension-patch-filter.jq
Original file line number Diff line number Diff line change
@@ -1,124 +1,119 @@
[
{
"op": "add",
"path": "/machine/install/extensions",
"value": [
{
"image": map(select(. | contains("nvidia") or contains("tailscale") or contains("xe-guest-utilities") | not)) | .[]
"machine": {
"install": {
"extensions": [
{
"image": map(select(. | contains("nvidia") or contains("tailscale") or contains("xe-guest-utilities") | not)) | .[]
}
],
},
"sysctls": {
"user.max_user_namespaces": "11255"
},
"kernel": {
"modules": [
{
"name": "asix"
},
{
"name": "ax88179_178a"
},
{
"name": "ax88796b"
},
{
"name": "binfmt_misc"
},
{
"name": "btrfs"
},
{
"name": "cdc_ether"
},
{
"name": "cdc_mbim"
},
{
"name": "cdc_ncm"
},
{
"name": "cdc_subset"
},
{
"name": "cdc_wdm"
},
{
"name": "cxgb"
},
{
"name": "cxgb3"
},
{
"name": "cxgb4"
},
{
"name": "cxgb4vf"
},
{
"name": "drbd"
},
{
"name": "gasket"
},
{
"name": "net1080"
},
{
"name": "option"
},
{
"name": "qmi_wwan"
},
{
"name": "r8153_ecm"
},
{
"name": "thunderbolt"
},
{
"name": "thunderbolt_net"
},
{
"name": "usb_wwan"
},
{
"name": "usbnet"
},
{
"name": "usbserial"
},
{
"name": "zaurus"
},
{
"name": "zfs"
}
]
}
]
},
{
"op": "add",
"path": "/machine/sysctls",
"value": {
"user.max_user_namespaces": "11255"
}
},
{
"op": "add",
"path": "/machine/kernel",
"value": {
"modules": [
{
"name": "asix"
},
{
"name": "ax88179_178a"
},
{
"name": "ax88796b"
},
{
"name": "binfmt_misc"
},
{
"name": "btrfs"
},
{
"name": "cdc_ether"
},
{
"name": "cdc_mbim"
},
{
"name": "cdc_ncm"
},
{
"name": "cdc_subset"
},
{
"name": "cdc_wdm"
},
{
"name": "cxgb"
},
{
"name": "cxgb3"
},
{
"name": "cxgb4"
},
{
"name": "cxgb4vf"
},
{
"name": "drbd"
},
{
"name": "gasket"
},
{
"name": "net1080"
},
{
"name": "option"
},
{
"name": "qmi_wwan"
},
{
"name": "r8153_ecm"
},
{
"name": "thunderbolt"
},
{
"name": "thunderbolt_net"
},
{
"name": "usb_wwan"
},
{
"name": "usbnet"
},
{
"name": "usbserial"
},
{
"name": "zaurus"
},
{
"name": "zfs"
}
]
}
"apiVersion": "v1alpha1",
"kind": "ExtensionServiceConfig",
"name": "tailscale",
"environment": [
"TS_AUTHKEY=tskey-0000000000000000"
]
},
{
"op": "add",
"path": "/machine/files",
"value": [
{
"path": "/var/etc/nut/upsmon.conf",
"permissions": 600,
"op": "create",
"content": "MONITOR ${upsmonHost} 1 remote ${upsmonPasswd} slave\nSHUTDOWNCMD \"/sbin/poweroff\""
},
"apiVersion": "v1alpha1",
"kind": "ExtensionServiceConfig",
"name": "nut-client",
"configFiles": [
{
"path": "/var/etc/tailscale/auth.env",
"permissions": 600,
"op": "create",
"content": ""
"content": "MONITOR ${upsmonHost} 1 remote ${upsmonPasswd} slave\nSHUTDOWNCMD \"/sbin/poweroff\"",
"mountPath": "/usr/local/etc/nut/upsmon.conf"
}
]
}
Expand Down

0 comments on commit f8b4ee8

Please sign in to comment.