#!/usr/bin/env herodo
// Test: VM Builder Configuration
// Tests that VMBuilder correctly builds VM configurations

print("=== Test: VM Builder Configuration ===");

// Test 1: Basic VM configuration
print("\n[TEST 1] Basic VM configuration");
let vm1 = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cmdline("console=ttyS0")
    .cpus(2)
    .memory(1024)
    .build();

print("✓ Basic VM configuration created");

// Test 2: VM with disk
print("\n[TEST 2] VM with virtio-blk disk");
let vm2 = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cmdline("console=ttyS0 root=/dev/vda1")
    .cpus(4)
    .memory(2048)
    .virtio_blk("/tmp/test-disk.img", false)
    .build();

print("✓ VM with disk created");

// Test 3: VM with multiple devices
print("\n[TEST 3] VM with multiple devices");
let vm3 = VMBuilder()
    .kernel("/tmp/test-kernel")
    .initramfs("/tmp/test-initrd")
    .cmdline("console=ttyS0 root=/dev/vda1")
    .cpus(8)
    .memory(4096)
    .virtio_blk("/tmp/disk1.img", false)
    .virtio_blk("/tmp/disk2.img", true)
    .virtio_net("tap0")
    .serial("tty")
    .console("off")
    .build();

print("✓ VM with multiple devices created");

// Test 4: VM with different CPU counts
print("\n[TEST 4] Various CPU configurations");
let vm_1cpu = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cpus(1)
    .memory(512)
    .build();
print("  ✓ 1 CPU VM");

let vm_16cpu = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cpus(16)
    .memory(8192)
    .build();
print("  ✓ 16 CPU VM");

// Test 5: VM with different memory sizes
print("\n[TEST 5] Various memory configurations");
let vm_512mb = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cpus(1)
    .memory(512)
    .build();
print("  ✓ 512 MB VM");

let vm_16gb = VMBuilder()
    .kernel("/tmp/test-kernel")
    .cpus(4)
    .memory(16384)
    .build();
print("  ✓ 16 GB VM");

print("\n=== All VM Builder tests passed! ===");
