From 4a07bd4ae3ad297b48ee520f099434fa456e88bb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 16:06:56 +0200 Subject: [PATCH] CI: import all the rest of the YAML schema - These have **not** been fixed for validation, so the schema's themselves will fail to load. This is a consequence of variations in JSON-Schema representations through various drafts. Fixing the schemata is fairly straightforward. This gives us 19 new tests, all of which fail. --- src/modules/bootloader/bootloader.schema.yaml | 18 ++++++++++ .../displaymanager/displaymanager.schema.yaml | 16 +++++++++ src/modules/fstab/fstab.schema.yaml | 19 +++++++++++ src/modules/grubcfg/grubcfg.schema.yaml | 15 +++++++++ src/modules/initcpio/initcpio.schema.yaml | 7 ++++ src/modules/keyboard/keyboard.schema.yaml | 8 +++++ src/modules/license/license.schema.yaml | 17 ++++++++++ src/modules/locale/locale.schema.yaml | 10 ++++++ .../luksopenswaphookcfg.schema.yaml | 7 ++++ src/modules/machineid/machineid.schema.yaml | 9 +++++ src/modules/mount/mount.schema.yaml | 24 ++++++++++++++ src/modules/netinstall/netinstall.schema.yaml | 7 ++++ src/modules/packages/packages.schema.yaml | 33 +++++++++++++++++++ src/modules/partition/partition.schema.yaml | 11 +++++++ .../plymouthcfg/plymouthcfg.schema.yaml | 7 ++++ src/modules/removeuser/removeuser.schema.yaml | 7 ++++ src/modules/umount/umount.schema.yaml | 8 +++++ src/modules/unpackfs/unpackfs.schema.yaml | 14 ++++++++ src/modules/users/users.schema.yaml | 18 ++++++++++ 19 files changed, 255 insertions(+) create mode 100644 src/modules/bootloader/bootloader.schema.yaml create mode 100644 src/modules/displaymanager/displaymanager.schema.yaml create mode 100644 src/modules/fstab/fstab.schema.yaml create mode 100644 src/modules/grubcfg/grubcfg.schema.yaml create mode 100644 src/modules/initcpio/initcpio.schema.yaml create mode 100644 src/modules/keyboard/keyboard.schema.yaml create mode 100644 src/modules/license/license.schema.yaml create mode 100644 src/modules/locale/locale.schema.yaml create mode 100644 src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml create mode 100644 src/modules/machineid/machineid.schema.yaml create mode 100644 src/modules/mount/mount.schema.yaml create mode 100644 src/modules/netinstall/netinstall.schema.yaml create mode 100644 src/modules/packages/packages.schema.yaml create mode 100644 src/modules/partition/partition.schema.yaml create mode 100644 src/modules/plymouthcfg/plymouthcfg.schema.yaml create mode 100644 src/modules/removeuser/removeuser.schema.yaml create mode 100644 src/modules/umount/umount.schema.yaml create mode 100644 src/modules/unpackfs/unpackfs.schema.yaml create mode 100644 src/modules/users/users.schema.yaml diff --git a/src/modules/bootloader/bootloader.schema.yaml b/src/modules/bootloader/bootloader.schema.yaml new file mode 100644 index 000000000..45e8d4996 --- /dev/null +++ b/src/modules/bootloader/bootloader.schema.yaml @@ -0,0 +1,18 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/bootloader +additionalProperties: false +type: object +properties: + efiBootLoader: { type: string, required: true } + kernel: { type: string, required: true } + img: { type: string, required: true } + fallback: { type: str } + timeout: { type: str } + bootloaderEntryName: { type: str } + kernelLine: { type: str } + fallbackKernelLine: { type: str } + grubInstall: { type: string, required: true } + grubMkconfig: { type: string, required: true } + grubCfg: { type: string, required: true } + efiBootloaderId: { type: str } diff --git a/src/modules/displaymanager/displaymanager.schema.yaml b/src/modules/displaymanager/displaymanager.schema.yaml new file mode 100644 index 000000000..a16af732f --- /dev/null +++ b/src/modules/displaymanager/displaymanager.schema.yaml @@ -0,0 +1,16 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/displaymanager +additionalProperties: false +type: object +properties: + "displaymanagers": + type: seq + sequence: + - { type: string, required: true, enum: [slim, sddm, lightdm, gdm, mdm, lxdm, kdm] } + "defaultDesktopEnvironment": + type: map + mapping: + "executable": { type: str } + "desktopFile": { type: str } + "basicSetup": { type: boolean, default: false } diff --git a/src/modules/fstab/fstab.schema.yaml b/src/modules/fstab/fstab.schema.yaml new file mode 100644 index 000000000..1c2bf459c --- /dev/null +++ b/src/modules/fstab/fstab.schema.yaml @@ -0,0 +1,19 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/fstab +additionalProperties: false +type: object +properties: + "mountOptions": + type: map + mapping: + "default": { type: string, required: true } + "btrfs": { type: string, required: true } + "ssdExtraMountOptions": + type: map + mapping: + "ext4": { type: string, required: true } + "jfs": { type: string, required: true } + "xfs": { type: string, required: true } + "swap": { type: string, required: true } + "btrfs": { type: string, required: true } diff --git a/src/modules/grubcfg/grubcfg.schema.yaml b/src/modules/grubcfg/grubcfg.schema.yaml new file mode 100644 index 000000000..10aa34c2b --- /dev/null +++ b/src/modules/grubcfg/grubcfg.schema.yaml @@ -0,0 +1,15 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/grubcfg +additionalProperties: false +type: object +properties: + "overwrite": { type: boolean, default: false } + "defaults": + type: map + mapping: + "GRUB_TIMEOUT": { type: int, required: true } + "GRUB_DEFAULT": { type: string, required: true } + "GRUB_DISABLE_SUBMENU": { type: boolean, default: true } + "GRUB_TERMINAL_OUTPUT": { type: string, required: true } + "GRUB_DISABLE_RECOVERY": { type: boolean, default: true } diff --git a/src/modules/initcpio/initcpio.schema.yaml b/src/modules/initcpio/initcpio.schema.yaml new file mode 100644 index 000000000..db81ba68e --- /dev/null +++ b/src/modules/initcpio/initcpio.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/initcpio +additionalProperties: false +type: object +properties: + kernel: { type: string, required: true } diff --git a/src/modules/keyboard/keyboard.schema.yaml b/src/modules/keyboard/keyboard.schema.yaml new file mode 100644 index 000000000..33175b84d --- /dev/null +++ b/src/modules/keyboard/keyboard.schema.yaml @@ -0,0 +1,8 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/finished +additionalProperties: keyboard +type: object +properties: + xOrgConfFileName: { type: string, required: true } + convertedKeymapPath: { type: string, required: true } diff --git a/src/modules/license/license.schema.yaml b/src/modules/license/license.schema.yaml new file mode 100644 index 000000000..62bd07035 --- /dev/null +++ b/src/modules/license/license.schema.yaml @@ -0,0 +1,17 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/license +additionalProperties: false +type: object +properties: + "entries": + type: seq + sequence: + - type: map + mapping: + "id": { type: str } + "name": { type: str } + "vendor": { type: str } + "type": { type: str } + "url": { type: str } + "required": { type: boolean, default: false } diff --git a/src/modules/locale/locale.schema.yaml b/src/modules/locale/locale.schema.yaml new file mode 100644 index 000000000..41c3ad487 --- /dev/null +++ b/src/modules/locale/locale.schema.yaml @@ -0,0 +1,10 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/locale +additionalProperties: false +type: object +properties: + "region": { type: str } + "zone": { type: str } + "localeGenPath": { type: string, required: true } + "geoipUrl": { type: str } diff --git a/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml new file mode 100644 index 000000000..660e06d0b --- /dev/null +++ b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/luksopenswaphookcfg +additionalProperties: false +type: object +properties: + "configFilePath": { type: string, required: true } diff --git a/src/modules/machineid/machineid.schema.yaml b/src/modules/machineid/machineid.schema.yaml new file mode 100644 index 000000000..588a7fa4e --- /dev/null +++ b/src/modules/machineid/machineid.schema.yaml @@ -0,0 +1,9 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/machineid +additionalProperties: false +type: object +properties: + "systemd": { type: boolean, default: true } + "dbus": { type: boolean, default: true } + "symlink": { type: boolean, default: true } diff --git a/src/modules/mount/mount.schema.yaml b/src/modules/mount/mount.schema.yaml new file mode 100644 index 000000000..8a81d9462 --- /dev/null +++ b/src/modules/mount/mount.schema.yaml @@ -0,0 +1,24 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/mount +additionalProperties: false +type: object +properties: + "extraMounts": + type: seq + sequence: + - type: map + mapping: + "device": { type: string, required: true } + "fs": { type: str } + "mountPoint": { type: string, required: true } + "options": { type: str } + "extraMountsEfi": + type: seq + sequence: + - type: map + mapping: + "device": { type: string, required: true } + "fs": { type: str } + "mountPoint": { type: string, required: true } + "options": { type: str } diff --git a/src/modules/netinstall/netinstall.schema.yaml b/src/modules/netinstall/netinstall.schema.yaml new file mode 100644 index 000000000..8420ea501 --- /dev/null +++ b/src/modules/netinstall/netinstall.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/netinstall +additionalProperties: false +type: object +properties: + groupsUrl: { type: string, required: true } diff --git a/src/modules/packages/packages.schema.yaml b/src/modules/packages/packages.schema.yaml new file mode 100644 index 000000000..8b8a9eb1d --- /dev/null +++ b/src/modules/packages/packages.schema.yaml @@ -0,0 +1,33 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/packages +additionalProperties: false +type: object +properties: + "backend": { type: string, required: true, enum: [packagekit, zypp, yum, dnf, urpmi, apt, pacman, portage, entropy] } + "update_db": { type: boolean, default: true } + "operations": + type: seq + sequence: + - type: map + mapping: + "install": + type: seq + sequence: + - { type: text } + "remove": + type: seq + sequence: + - { type: text } + "localInstall": + type: seq + sequence: + - { type: text } + "try_install": + type: seq + sequence: + - { type: text } + "try_remove": + type: seq + sequence: + - { type: text } diff --git a/src/modules/partition/partition.schema.yaml b/src/modules/partition/partition.schema.yaml new file mode 100644 index 000000000..198123dd5 --- /dev/null +++ b/src/modules/partition/partition.schema.yaml @@ -0,0 +1,11 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/partition +additionalProperties: false +type: object +properties: + efiSystemPartition: { type: string, required: true } + ensureSuspendToDisk: { type: boolean, default: true } + drawNestedPartitions: { type: boolean, default: false } + alwaysShowPartitionLabels: { type: boolean, default: true } + defaultFileSystemType: { type: string, required: true } diff --git a/src/modules/plymouthcfg/plymouthcfg.schema.yaml b/src/modules/plymouthcfg/plymouthcfg.schema.yaml new file mode 100644 index 000000000..b15db1527 --- /dev/null +++ b/src/modules/plymouthcfg/plymouthcfg.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/plymouthcfg +additionalProperties: false +type: object +properties: + plymouth_theme: { type: str } diff --git a/src/modules/removeuser/removeuser.schema.yaml b/src/modules/removeuser/removeuser.schema.yaml new file mode 100644 index 000000000..7ed6cfbbe --- /dev/null +++ b/src/modules/removeuser/removeuser.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/removeuser +additionalProperties: false +type: object +properties: + "username": { type: string, required: true } diff --git a/src/modules/umount/umount.schema.yaml b/src/modules/umount/umount.schema.yaml new file mode 100644 index 000000000..b76a14ac6 --- /dev/null +++ b/src/modules/umount/umount.schema.yaml @@ -0,0 +1,8 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/umount +additionalProperties: false +type: object +properties: + "srcLog": { type: str } + "destLog": { type: str } diff --git a/src/modules/unpackfs/unpackfs.schema.yaml b/src/modules/unpackfs/unpackfs.schema.yaml new file mode 100644 index 000000000..0d6f0955a --- /dev/null +++ b/src/modules/unpackfs/unpackfs.schema.yaml @@ -0,0 +1,14 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/unpackfs +additionalProperties: false +type: object +properties: + "unpack": + type: seq + sequence: + - type: map + mapping: + "source": { type: string, required: true } + "sourcefs": { type: str } + "destination": { type: str } diff --git a/src/modules/users/users.schema.yaml b/src/modules/users/users.schema.yaml new file mode 100644 index 000000000..b667df7f6 --- /dev/null +++ b/src/modules/users/users.schema.yaml @@ -0,0 +1,18 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/users +additionalProperties: false +type: object +properties: + "defaultGroups": + required: true + type: seq + sequence: + - { type: str } + "autologinGroup": { type: string, required: true } + "doAutologin": { type: boolean, default: true } + "sudoersGroup": { type: string, required: true } + "setRootPassword": { type: boolean, default: true } + "availableShells": { type: str } + "avatarFilePath": { type: str } + "doReusePassword": { type: boolean, default: true }