#!/bin/sh
set -ex

# Flag container environment so cuttlefish host validation skips kvm/group checks in LXC testbed
touch /.dockerenv

echo "=== Verifying /usr/bin/cvd exists and is executable ==="
if [ ! -x /usr/bin/cvd ]; then
    echo "ERROR: /usr/bin/cvd is not executable or does not exist"
    exit 1
fi

echo "=== Testing cvd version ==="
cvd version

echo "=== Testing cvd help ==="
cvd help

echo "=== autopkgtest for cvd passed successfully! ==="
