Repository: cobbler/cobbler

Issue:
grubx86.efi vs grubx64.efi (DHCPv4 -> EFI does not work)
### Either settings.yaml and dhcp6.template are wrong, or dhcp.template, documentation, and tests are wrong

In dhcp.template, cobbler currently references `grubx64.efi` for x86_64 EFI boots, while dhcp6.template references `grubx86.efi` (for the same function). `cobbler mkloaders` generates grubx86.efi based on `settings.yaml` -> `bootloader_formats` -> `x86_64_efi` -> `binary_name` being set to `grubx86.efi`.

This results in the current dhcp.template being unable to use the EFI bootloaders since the filename is wrong.

A quick fix would be to `s/grubx64.efi/grubx86.efi/` in `dhcp.template`, although I would argue the correct way to solve it would be to rename the `binary_name` to grubx64.efi in `settings.yaml`, the `grubx86.efi` in `dhcp6.template` to `grubx64.efi`, and doing whatever needs to be done in `cobbler/settings/migrations` (in which files also reference `grubx86.efi`). This would be in line with other tests and documentation within cobbler (including `mkloaders_test.py`, `cobbler.rst`, `grub.rst`, `system-tests/listings/*/*/*/index`, and generally grubx64.efi being named that way on many Linux distribution EFI directories.

### Steps to reproduce

1. Use ISC DHCP v4 to attempt to boot via PXE on an EFI system
2. Failure due to grubx64.efi not being present on tftp

### Expected behavior

The default templates for DHCP to work out of the box with `cobbler mkloaders`-provided bootloaders

### Cobbler version

<!--- Paste output from `cobbler version` -->
````paste below
cobbler version
Cobbler 3.3.3
  source: b4df3716, Mon Apr 25 13:19:08 2022 +0200
  build time: Fri May  6 13:25:13 2022
````

### Operating system

AlmaLinux 8.5

### Additional information

<!--- Add any other context about the problem here. -->



Discussion:
Okay so I believe as argued by the reporter that we actually want `grubx64.efi` as a name in all places.

Resolving patch:
diff --git a/cobbler/settings/__init__.py b/cobbler/settings/__init__.py
--- a/cobbler/settings/__init__.py
+++ b/cobbler/settings/__init__.py
@@ -87,7 +87,7 @@ def __init__(self):
                 "extra_modules": ["net", "ofnet"],
             },
             "x86_64-efi": {
-                "binary_name": "grubx86.efi",
+                "binary_name": "grubx64.efi",
                 "extra_modules": ["chain", "efinet"],
             },
         }


Test patch:
diff --git a/.github/workflows/system_testing.yml b/.github/workflows/system_testing.yml
--- a/.github/workflows/system_testing.yml
+++ b/.github/workflows/system_testing.yml
@@ -7,7 +7,45 @@ on:
     branches: [ main, release* ]
 
 jobs:
-  run_system_test:
+  basic:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      - name: Pull Docker Test Container
+        run: docker pull registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Run previously built Docker Container
+        run: docker run --cap-add=NET_ADMIN -t -d -v $PWD:/code --name cobbler registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Setup Cobbler in the Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "./docker/develop/scripts/setup-supervisor.sh"
+      - name: Run the Tests inside the Docker Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "make SYSTESTS='basic-*' system-test"
+      - name: Stop and remove the container
+        run: docker stop cobbler && docker rm cobbler
+  import:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      - name: Pull Docker Test Container
+        run: docker pull registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Run previously built Docker Container
+        run: docker run --cap-add=NET_ADMIN -t -d -v $PWD:/code --name cobbler registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Setup Cobbler in the Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "./docker/develop/scripts/setup-supervisor.sh"
+      - name: Run the Tests inside the Docker Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "make SYSTESTS='import-*' system-test"
+      - name: Stop and remove the container
+        run: docker stop cobbler && docker rm cobbler
+  settings-cli:
     runs-on: ubuntu-20.04
     steps:
       - name: Checkout repository
@@ -23,6 +61,25 @@ jobs:
       - name: Run the Tests inside the Docker Container
         shell: 'script -q -e -c "bash {0}"'
         run: |
-          docker exec -u 0 -it cobbler bash -c "make system-test"
+          docker exec -u 0 -it cobbler bash -c "make SYSTESTS='settings-cli-*' system-test"
+      - name: Stop and remove the container
+        run: docker stop cobbler && docker rm cobbler
+  svc:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      - name: Pull Docker Test Container
+        run: docker pull registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Run previously built Docker Container
+        run: docker run --cap-add=NET_ADMIN -t -d -v $PWD:/code --name cobbler registry.opensuse.org/home/schoolguy/branches/opensuse/templates/images/tumbleweed/containers/opensuse/cobbler-github-ci:latest
+      - name: Setup Cobbler in the Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "./docker/develop/scripts/setup-supervisor.sh"
+      - name: Run the Tests inside the Docker Container
+        shell: 'script -q -e -c "bash {0}"'
+        run: |
+          docker exec -u 0 -it cobbler bash -c "make SYSTESTS='svc-*' system-test"
       - name: Stop and remove the container
         run: docker stop cobbler && docker rm cobbler
diff --git a/system-tests/tests/settings-cli-migrate b/system-tests/tests/settings-cli-migrate
--- a/system-tests/tests/settings-cli-migrate
+++ b/system-tests/tests/settings-cli-migrate
@@ -53,7 +53,7 @@ bootloaders_formats:
       - net
       - ofnet
   x86_64-efi:
-    binary_name: grubx86.efi
+    binary_name: grubx64.efi
     extra_modules:
       - chain
       - efinet
diff --git a/system-tests/tests/svc-puppet b/system-tests/tests/svc-puppet
--- a/system-tests/tests/svc-puppet
+++ b/system-tests/tests/svc-puppet
@@ -17,7 +17,7 @@ TODO
 EOF
 
 # Act
-curl --output=${tmp}/b http://localhost/cblr/svc/op/puppet/
+curl --output ${tmp}/b http://localhost/cblr/svc/op/puppet/
 
 # Assert
 # FIXME endpoint not yet testable
diff --git a/system-tests/tests/svc-settings b/system-tests/tests/svc-settings
--- a/system-tests/tests/svc-settings
+++ b/system-tests/tests/svc-settings
@@ -212,7 +212,7 @@ cat >${tmp}/a <<-EOF
             ]
         },
         "x86_64-efi": {
-            "binary_name": "grubx86.efi",
+            "binary_name": "grubx64.efi",
             "extra_modules": [
                 "chain",
                 "efinet"
diff --git a/tests/actions/buildiso_test.py b/tests/actions/buildiso_test.py
--- a/tests/actions/buildiso_test.py
+++ b/tests/actions/buildiso_test.py
@@ -47,7 +47,7 @@ class TestBuildiso:
     @pytest.mark.parametrize(
         "input_arch,result_binary_name,expected_exception",
         [
-            (enums.Archs.X86_64, "grubx86.efi", does_not_raise()),
+            (enums.Archs.X86_64, "grubx64.efi", does_not_raise()),
             (enums.Archs.PPC, "grub.ppc64le", does_not_raise()),
             (enums.Archs.PPC64, "grub.ppc64le", does_not_raise()),
             (enums.Archs.PPC64EL, "grub.ppc64le", does_not_raise()),
diff --git a/tests/test_data/V3_4_0/settings.yaml b/tests/test_data/V3_4_0/settings.yaml
--- a/tests/test_data/V3_4_0/settings.yaml
+++ b/tests/test_data/V3_4_0/settings.yaml
@@ -74,7 +74,7 @@ bootloaders_formats:
       - net
       - ofnet
   x86_64-efi:
-    binary_name: grubx86.efi
+    binary_name: grubx64.efi
     extra_modules:
       - chain
       - efinet