Files
nixpkgs/pkgs/by-name/co/collectl/test.nix
seven_bear 3f4a4648bd collectl: init at 4.3.20.1
- Add collectl 4.3.20.1 performance monitoring tool for Linux systems
- Add test suite for configuration functionality
- Include patches for external tool handling and install script fixes
- Document --config option in package metadata
- Add maintainer entry for seven_bear

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-17 11:42:46 +08:00

45 lines
1.2 KiB
Nix

{
runCommand,
collectl,
coreutils,
}:
runCommand "collectl-test"
{
nativeBuildInputs = [
collectl
coreutils
];
meta.timeout = 60;
}
''
# Test basic functionality - limit to 5 seconds to avoid hanging
timeout 5s collectl -c1 >/dev/null || true
# Test that explicit config file option still works with original config
timeout 5s collectl --config ${collectl}/etc/collectl.conf -c1 >/dev/null || true
# Test custom config file path override
custom_config_path=$(mktemp)
cp ${collectl}/etc/collectl.conf "$custom_config_path"
# Test that collectl uses the custom config file path
config_output=$(timeout 5s collectl --config "$custom_config_path" -c1 -d1 2>&1 | grep -i "Config File Search Path:" | head -1)
expected_output="Config File Search Path: $custom_config_path"
if [ "$config_output" = "$expected_output" ]; then
echo "✓ Custom config file path test passed"
else
echo "✗ Custom config file path test failed"
echo "Expected: $expected_output"
echo "Got: $config_output"
exit 1
fi
# Cleanup
rm -f "$custom_config_path"
# Signal success
touch $out
''