Files
herolib/examples/virt/heropods/demo.heroscript
Mahmoud-Emad 9986dca758 test: Replace hero binary checks with network test
- Test network connectivity using wget
- Removed checks for hero binary existence and version
2025-11-19 11:03:17 +02:00

33 lines
829 B
Plaintext
Executable File

#!/usr/bin/env hero
// Configure the heropods instance
!!heropods.configure
name:'demo'
reset:false
use_podman:true
// Create a new Alpine container using podman to pull the image
// Note: Hero binary is ALWAYS automatically included in all containers
!!heropods.container_new
name:'demo_container'
image:'custom'
custom_image_name:'alpine_3_20'
docker_url:'docker.io/library/alpine:3.20'
// Start the container
!!heropods.container_start
name:'demo_container'
// Test network connectivity with wget (ping requires capabilities in Alpine)
!!heropods.container_exec
name:'demo_container'
cmd:'wget -O- http://google.com --timeout=5 2>&1 | head -n 5'
stdout:true
// Clean up
!!heropods.container_stop
name:'demo_container'
!!heropods.container_delete
name:'demo_container'