mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
tests: Fix spelling errors found by codespell
Signed-off-by: Colin Watson <cjwatson@debian.org>
This commit is contained in:
parent
4221663596
commit
4e37b921df
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
export PATH="$GOPATH/bin:$PATH"
|
||||
|
||||
# /tmp isn't moutned exec on most systems, so we can't actually start
|
||||
# /tmp isn't mounted exec on most systems, so we can't actually start
|
||||
# containers that are created there.
|
||||
SRC_DIR="$(pwd)"
|
||||
INCUS_DIR="$(mktemp -d -p "$(pwd)")"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
`mini-oidc` is an extremely basic OIDC provider which can be used with the `incus` command line.
|
||||
It doesn't use web authentication and instead just automatically approves any authentication request.
|
||||
|
||||
By default, it will authenticate everyone as `unknown`, but this can be overriden by writing the username to be returned in the `user.data` file.
|
||||
By default, it will authenticate everyone as `unknown`, but this can be overridden by writing the username to be returned in the `user.data` file.
|
||||
This effectively allows scripting a variety of users without having to deal with actual login.
|
||||
|
||||
The `storage` sub-package is a copy of https://github.com/zitadel/oidc/tree/main/example/server/storage with the exception of the added IncusDeviceClient.
|
||||
|
||||
@ -18,7 +18,7 @@ const (
|
||||
// CustomClaim is an example for how to return custom claims with this library
|
||||
CustomClaim = "custom_claim"
|
||||
|
||||
// CustomScopeImpersonatePrefix is an example scope prefix for passing user id to impersonate using token exchage
|
||||
// CustomScopeImpersonatePrefix is an example scope prefix for passing user id to impersonate using token exchange.
|
||||
CustomScopeImpersonatePrefix = "custom_scope:impersonate:"
|
||||
)
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ EOF
|
||||
incus exec c1 --project test -- mount | grep /mnt
|
||||
incus exec c1 --project test -- grep -xF "hello world" /mnt/test.txt
|
||||
|
||||
# Check snashot can be restored.
|
||||
# Check snapshot can be restored.
|
||||
incus snapshot restore c1 snap0
|
||||
incus info c1
|
||||
incus exec c1 --project test -- hostname
|
||||
@ -977,7 +977,7 @@ test_backup_export_import_recover() {
|
||||
incus import "${INCUS_DIR}/c1.tar.gz" c2
|
||||
rm "${INCUS_DIR}/c1.tar.gz"
|
||||
|
||||
# Remove imported instance enteries from database.
|
||||
# Remove imported instance entries from database.
|
||||
incus admin sql global "delete from instances where name = 'c2'"
|
||||
incus admin sql global "delete from storage_volumes where name = 'c2'"
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ test_basic_usage() {
|
||||
# Test container creation
|
||||
incus init testimage foo
|
||||
incus list | grep foo | grep STOPPED
|
||||
incus list fo | grep foo | grep STOPPED
|
||||
incus list fo | grep foo | grep STOPPED # codespell:ignore fo
|
||||
|
||||
# Test list json format
|
||||
incus list --format json | jq '.[]|select(.name="foo")' | grep '"name": "foo"'
|
||||
|
||||
@ -318,10 +318,10 @@ test_clustering_membership() {
|
||||
# Set cluster token expiry to 30 seconds
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus config set cluster.join_token_expiry=30S
|
||||
|
||||
# Generate a join token for an eigth and ninth node
|
||||
# Generate a join token for an eighth and ninth node
|
||||
token_valid=$(INCUS_DIR="${INCUS_ONE_DIR}" incus cluster add node8 --quiet)
|
||||
|
||||
# Spawn an eigth node, using join token.
|
||||
# Spawn an eighth node, using join token.
|
||||
setup_clustering_netns 8
|
||||
INCUS_EIGHT_DIR=$(mktemp -d -p "${TEST_DIR}" XXX)
|
||||
chmod +x "${INCUS_EIGHT_DIR}"
|
||||
@ -1136,7 +1136,7 @@ test_clustering_network() {
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus admin sql global "SELECT nodes.name,networks_nodes.state FROM nodes JOIN networks_nodes ON networks_nodes.node_id = nodes.id JOIN networks ON networks.id = networks_nodes.network_id WHERE networks.name = '${net}' AND nodes.name = 'node1'" | grep "| node1 | 0 |"
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus admin sql global "SELECT nodes.name,networks_nodes.state FROM nodes JOIN networks_nodes ON networks_nodes.node_id = nodes.id JOIN networks ON networks.id = networks_nodes.network_id WHERE networks.name = '${net}' AND nodes.name = 'node2'" | grep "| node2 | 0 |"
|
||||
|
||||
# Run network create on other node2 (still excpect to fail on node1, but expect node2 create to succeed).
|
||||
# Run network create on other node2 (still expect to fail on node1, but expect node2 create to succeed).
|
||||
! INCUS_DIR="${INCUS_TWO_DIR}" incus network create "${net}" || false
|
||||
|
||||
# Check each node status (expect node1 to be pending and node2 to be created).
|
||||
@ -2749,7 +2749,7 @@ test_clustering_image_refresh() {
|
||||
# Copy the public image to each project
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus image copy public:testimage local: --alias testimage --target-project "${project}"
|
||||
|
||||
# Diable autoupdate for testimage in project foo
|
||||
# Disable autoupdate for testimage in project foo
|
||||
if [ "${project}" = "foo" ]; then
|
||||
auto_update=false
|
||||
else
|
||||
@ -3274,7 +3274,7 @@ test_clustering_remove_members() {
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus cluster rm node4
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus cluster rm node5
|
||||
|
||||
# Ensure the remaining node is working and node2, node3, node4,node5 successful reomve from cluster
|
||||
# Ensure the remaining node is working and node2, node3, node4,node5 successful remove from cluster
|
||||
! INCUS_DIR="${INCUS_ONE_DIR}" incus cluster list | grep -q "node2" || false
|
||||
! INCUS_DIR="${INCUS_ONE_DIR}" incus cluster list | grep -q "node3" || false
|
||||
! INCUS_DIR="${INCUS_ONE_DIR}" incus cluster list | grep -q "node4" || false
|
||||
@ -3284,7 +3284,7 @@ test_clustering_remove_members() {
|
||||
# Start node 6
|
||||
INCUS_NETNS="${ns6}" respawn_incus "${INCUS_SIX_DIR}" true
|
||||
|
||||
# make sure node6 is a spare ndoe
|
||||
# make sure node6 is a spare node
|
||||
INCUS_DIR="${INCUS_ONE_DIR}" incus cluster list | grep -q "node6"
|
||||
! INCUS_DIR="${INCUS_ONE_DIR}" incus cluster show node6 | grep -qE "\- database-standy$|\- database-leader$|\- database$" || false
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ test_container_devices_nic_bridged() {
|
||||
false
|
||||
fi
|
||||
|
||||
# Check profile limits are applie on hot-removal.
|
||||
# Check profile limits are applied on hot-removal.
|
||||
if ! tc class show dev "${vethHostName}" | grep "1Mbit" ; then
|
||||
echo "limits.ingress invalid"
|
||||
false
|
||||
@ -279,25 +279,25 @@ test_container_devices_nic_bridged() {
|
||||
|
||||
# Check removing a required option fails.
|
||||
if incus config device unset "${ctName}" eth0 parent ; then
|
||||
echo "shouldnt be able to unset invalrequiredid option"
|
||||
echo "shouldn't be able to unset invalrequiredid option"
|
||||
false
|
||||
fi
|
||||
|
||||
# Check updating an invalid option fails.
|
||||
if incus config device set "${ctName}" eth0 invalid.option "invalid value" ; then
|
||||
echo "shouldnt be able to set invalid option"
|
||||
echo "shouldn't be able to set invalid option"
|
||||
false
|
||||
fi
|
||||
|
||||
# Check setting invalid IPv4 route.
|
||||
if incus config device set "${ctName}" eth0 ipv4.routes "192.0.2.1/33" ; then
|
||||
echo "shouldnt be able to set invalid ipv4.routes value"
|
||||
echo "shouldn't be able to set invalid ipv4.routes value"
|
||||
false
|
||||
fi
|
||||
|
||||
# Check setting invalid IPv6 route.
|
||||
if incus config device set "${ctName}" eth0 ipv6.routes "2001:db8::1/129" ; then
|
||||
echo "shouldnt be able to set invalid ipv6.routes value"
|
||||
echo "shouldn't be able to set invalid ipv6.routes value"
|
||||
false
|
||||
fi
|
||||
|
||||
|
||||
@ -274,7 +274,7 @@ test_container_devices_nic_bridged_filtering() {
|
||||
incus config device unset "${ctPrefix}A" eth0 ipv4.address
|
||||
incus start "${ctPrefix}A"
|
||||
if ! grep "192.0.2.2" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctPrefix}A.eth0" ; then
|
||||
echo "dnsmasq host config doesnt contain previous lease as static IPv4 config"
|
||||
echo "dnsmasq host config doesn't contain previous lease as static IPv4 config"
|
||||
false
|
||||
fi
|
||||
|
||||
@ -291,7 +291,7 @@ test_container_devices_nic_bridged_filtering() {
|
||||
incus start "${ctPrefix}A"
|
||||
|
||||
if ! grep "192.0.2.3" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctPrefix}A.eth0" ; then
|
||||
echo "dnsmasq host config doesnt contain sequentially allocated static IPv4 config"
|
||||
echo "dnsmasq host config doesn't contain sequentially allocated static IPv4 config"
|
||||
false
|
||||
fi
|
||||
|
||||
@ -301,7 +301,7 @@ test_container_devices_nic_bridged_filtering() {
|
||||
incus start "${ctPrefix}A"
|
||||
|
||||
if ! grep "192.0.2.100" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctPrefix}A.eth0" ; then
|
||||
echo "dnsmasq host config doesnt contain sequentially range allocated static IPv4 config"
|
||||
echo "dnsmasq host config doesn't contain sequentially range allocated static IPv4 config"
|
||||
false
|
||||
fi
|
||||
|
||||
@ -526,7 +526,7 @@ test_container_devices_nic_bridged_filtering() {
|
||||
incus config device set "${ctPrefix}A" eth0 security.ipv6_filtering true
|
||||
incus start "${ctPrefix}A"
|
||||
if ! grep "\\[2001:db8:1:0:1266:6aff:fe92:f3c1\\]" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctPrefix}A.eth0" ; then
|
||||
echo "dnsmasq host config doesnt contain dynamically allocated static IPv6 config"
|
||||
echo "dnsmasq host config doesn't contain dynamically allocated static IPv6 config"
|
||||
false
|
||||
fi
|
||||
|
||||
@ -542,7 +542,7 @@ test_container_devices_nic_bridged_filtering() {
|
||||
incus config device set "${ctPrefix}A" eth0 security.ipv6_filtering true
|
||||
incus start "${ctPrefix}A"
|
||||
if ! grep "\\[2001:db8:1::2\\]" "${INCUS_DIR}/networks/${brName}/dnsmasq.hosts/${ctPrefix}A.eth0" ; then
|
||||
echo "dnsmasq host config doesnt contain sequentially allocated static IPv6 config"
|
||||
echo "dnsmasq host config doesn't contain sequentially allocated static IPv6 config"
|
||||
false
|
||||
fi
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ test_container_devices_nic_ipvlan() {
|
||||
incus exec "${ctName}2" -- ping6 -c2 -W5 "2001:db8::1${ipRand}"
|
||||
incus stop -f "${ctName}2"
|
||||
|
||||
# Check IPVLAN ontop of VLAN parent with custom routing tables.
|
||||
# Check IPVLAN on top of VLAN parent with custom routing tables.
|
||||
incus stop -f "${ctName}"
|
||||
incus config device set "${ctName}" eth0 vlan 1234
|
||||
incus config device set "${ctName}" eth0 ipv4.host_table=100
|
||||
|
||||
@ -15,7 +15,7 @@ test_container_devices_nic_macvlan() {
|
||||
# Test pre-launch profile config is applied at launch.
|
||||
incus profile copy default "${ctName}"
|
||||
|
||||
# Modifiy profile nictype and parent in atomic operation to ensure validation passes.
|
||||
# Modify profile nictype and parent in atomic operation to ensure validation passes.
|
||||
incus profile show "${ctName}" | sed "s/nictype: p2p/nictype: macvlan\\n parent: ${ctName}/" | incus profile edit "${ctName}"
|
||||
incus profile device set "${ctName}" eth0 mtu "1400"
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ test_container_devices_nic_routed() {
|
||||
incus stop -f "${ctName}2"
|
||||
incus stop -f "${ctName}"
|
||||
|
||||
# Check routed ontop of VLAN parent with custom routing tables.
|
||||
# Check routed on top of VLAN parent with custom routing tables.
|
||||
incus config device set "${ctName}" eth0 vlan 1234
|
||||
incus config device set "${ctName}" eth0 ipv4.host_table=100
|
||||
incus config device set "${ctName}" eth0 ipv6.host_table=101
|
||||
|
||||
@ -2,7 +2,7 @@ test_snapshots() {
|
||||
snapshots
|
||||
|
||||
if [ "$(storage_backend "$INCUS_DIR")" = "lvm" ]; then
|
||||
# Test that non-thinpool lvm backends work fine with snaphots.
|
||||
# Test that non-thinpool lvm backends work fine with snapshots.
|
||||
incus storage create "incustest-$(basename "${INCUS_DIR}")-non-thinpool-lvm-snapshots" lvm lvm.use_thinpool=false volume.size=25MiB
|
||||
incus profile device set default root pool "incustest-$(basename "${INCUS_DIR}")-non-thinpool-lvm-snapshots"
|
||||
|
||||
@ -100,7 +100,7 @@ test_snap_restore() {
|
||||
snap_restore
|
||||
|
||||
if [ "$(storage_backend "$INCUS_DIR")" = "lvm" ]; then
|
||||
# Test that non-thinpool lvm backends work fine with snaphots.
|
||||
# Test that non-thinpool lvm backends work fine with snapshots.
|
||||
incus storage create "incustest-$(basename "${INCUS_DIR}")-non-thinpool-lvm-snap-restore" lvm lvm.use_thinpool=false volume.size=25MiB
|
||||
incus profile device set default root pool "incustest-$(basename "${INCUS_DIR}")-non-thinpool-lvm-snap-restore"
|
||||
|
||||
@ -210,21 +210,21 @@ snap_restore() {
|
||||
# test restore using full snapshot name
|
||||
restore_and_compare_fs snap1
|
||||
|
||||
# Check that instances UUID remain the same before and after snapshoting
|
||||
# Check that instances UUID remain the same before and after snapshotting
|
||||
newUUID=$(incus config get bar volatile.uuid)
|
||||
if [ "${initialUUID}" != "${newUUID}" ]; then
|
||||
echo "==> UUID of the instance should remain the same after restoring its snapshot"
|
||||
false
|
||||
fi
|
||||
|
||||
# Check that the generation UUID from before changes compared to the one after snapshoting
|
||||
# Check that the generation UUID from before changes compared to the one after snapshotting
|
||||
newGenerationID=$(incus config get bar volatile.uuid.generation)
|
||||
if [ "${initialGenerationID}" = "${newGenerationID}" ]; then
|
||||
echo "==> Generation UUID of the instance should change after restoring its snapshot"
|
||||
false
|
||||
fi
|
||||
|
||||
# Check that instances UUIS remain the same before and after snapshoting (stateful mode)
|
||||
# Check that instances UUIS remain the same before and after snapshotting (stateful mode)
|
||||
if ! command -v criu >/dev/null 2>&1; then
|
||||
echo "==> SKIP: stateful snapshotting with CRIU (missing binary)"
|
||||
else
|
||||
|
||||
@ -75,7 +75,7 @@ test_storage_buckets() {
|
||||
|
||||
# Check bucket name validation.
|
||||
! incus storage bucket create "${poolName}" .foo || false
|
||||
! incus storage bucket create "${poolName}" fo || false
|
||||
! incus storage bucket create "${poolName}" fo || false # codespell:ignore fo
|
||||
! incus storage bucket create "${poolName}" fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo || false
|
||||
! incus storage bucket create "${poolName}" "foo bar" || false
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ test_storage_local_volume_handling() {
|
||||
|
||||
# check snapshot volumes (including config) was overridden from new source and that missing snapshot is
|
||||
# present and that the missing snapshot has been removed.
|
||||
# Note: We are currently diffing the snapshots by name and creation date, so infact existing
|
||||
# Note: We are currently diffing the snapshots by name and creation date, so in fact existing
|
||||
# snapshots of the same name and cretion date won't be overwritten even if their config or contents is different.
|
||||
incus storage volume get "${target_pool}" vol5 user.foo | grep -Fx "snapremovevol5"
|
||||
incus storage volume get "${target_pool}" vol5/snap0 user.foo | grep -Fx "snap0vol5"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user