Skip to content

Commit

Permalink
for testing only
Browse files Browse the repository at this point in the history
  • Loading branch information
kasabe28 committed Dec 29, 2023
1 parent 4367573 commit efd0797
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ jobs:
sudo apt-get install -y cpu-checker
sudo kvm-ok
sudo apt-get install -y qemu-kvm libvirt-daemon-system
sudo usermod -aG kvm $USER
sudo usermod -aG libvirt $USER
sudo setfacl -m user:$USER:rw /var/run/libvirt/libvirt-sock
sudo systemctl enable --now libvirtd
sudo systemctl start libvirtd
sudo systemctl status libvirtd
sudo update-ca-certificates
sudo rm -rf /var/lib/apt/lists
sudo lspci -nn
virsh nodedev-dumpxml pci_0000_00_08_0
sudo ls -la /var/run/libvirt/libvirt-sock
sudo ls -l /dev/kvm
- name: Run go tests
run: |
Expand Down
4 changes: 3 additions & 1 deletion pkg/controllers/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ func (r *MachineReconciler) domainFor(
return nil, nil, nil, err
}

domainSettings.Type = "kvm"

domainDesc := &libvirtxml.Domain{
Name: machine.GetID(),
UUID: machine.GetID(),
Expand Down Expand Up @@ -609,7 +611,7 @@ func (r *MachineReconciler) setDomainResources(ctx context.Context, log logr.Log
func (r *MachineReconciler) setDomainPCIControllers(machine *api.Machine, domain *libvirtxml.Domain) error {
domain.Devices.Controllers = append(domain.Devices.Controllers, libvirtxml.DomainController{
Type: "pci",
Model: "pci-root",
Model: "pcie-root",
})

for i := 1; i <= 30; i++ {
Expand Down
24 changes: 8 additions & 16 deletions provider/server/machine_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var _ = Describe("Create Machine", func() {
},
Spec: &iri.MachineSpec{
Power: iri.Power_POWER_ON,
Image: &iri.ImageSpec{
Image: "example.org/foo:latest",
},
// Image: &iri.ImageSpec{
// Image: "example.org/foo:latest",
// },
Class: machineClassx3xlarge,
IgnitionData: ignitionData,
// TODO: will be done when convertMachineToIRIMachine() supports Volumes and NetworkInterfaces
Expand All @@ -41,7 +41,7 @@ var _ = Describe("Create Machine", func() {
Expect(createResp).Should(SatisfyAll(
HaveField("Machine.Metadata.Id", Not(BeEmpty())),
HaveField("Machine.Spec.Power", iri.Power_POWER_ON),
HaveField("Machine.Spec.Image", Not(BeNil())),
HaveField("Machine.Spec.Image", BeNil()),
HaveField("Machine.Spec.Class", machineClassx3xlarge),
HaveField("Machine.Spec.IgnitionData", Equal(ignitionData)),
HaveField("Machine.Spec.Volumes", BeNil()),
Expand Down Expand Up @@ -69,18 +69,10 @@ var _ = Describe("Create Machine", func() {
return resp.Machines[0].Status
}).Should(SatisfyAll(
HaveField("State", Equal(iri.MachineState_MACHINE_RUNNING)),
// HaveField("Access", SatisfyAll(
// HaveField("Driver", "ceph"),
// HaveField("Handle", image.Spec.WWN),
// HaveField("Attributes", SatisfyAll(
// HaveKeyWithValue("monitors", image.Status.Access.Monitors),
// HaveKeyWithValue("image", image.Status.Access.Handle),
// )),
// HaveField("SecretData", SatisfyAll(
// HaveKeyWithValue("userID", []byte(image.Status.Access.User)),
// HaveKeyWithValue("userKey", []byte(image.Status.Access.UserKey)),
// )),
// )),
HaveField("ObservedGeneration", BeZero()),
HaveField("ImageRef", BeEmpty()),
HaveField("Volumes", BeNil()),
HaveField("NetworkInterfaces", BeNil()),
))
})
})
10 changes: 5 additions & 5 deletions provider/server/server_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ var _ = BeforeSuite(func() {
RootDir: fmt.Sprintf("%s/libvirt-provider", userHomeDir),
StreamingAddress: streamingAddress,
Libvirt: app.LibvirtOptions{
Socket: "/var/run/libvirt/libvirt-sock",
URI: "qemu:///system",
// PreferredDomainTypes: []string{"kvm", "qemu"},
// PreferredMachineTypes: []string{"pc-i440fx-2.9", "pc-i440fx-2.8"},
Qcow2Type: "exec",
Socket: "/var/run/libvirt/libvirt-sock",
URI: "qemu:///system",
PreferredDomainTypes: []string{"kvm", "qemu"},
PreferredMachineTypes: []string{"pc-q35", "pc-i440fx-2.9", "pc-i440fx-2.8"},
Qcow2Type: "exec",
},
NicPlugin: apinetPlugin,
// TODO: add other required fields
Expand Down

0 comments on commit efd0797

Please sign in to comment.