<commit_before>package main

import (
	"github.com/opencontainers/runtime-tools/validation/util"
)

func main() {
	g, err := util.GetDefaultGenerator()
	if err != nil {
		util.Fatal(err)
	}
	g.SetHostname("hostname-specific")
	err = util.RuntimeInsideValidate(g, nil)
	if err != nil {
		util.Fatal(err)
	}
}<commit_msg>validation: test validation test with an empty hostname<commit_after>package main

import (
	"fmt"
	"runtime"

	"github.com/mndrix/tap-go"
	"github.com/opencontainers/runtime-tools/validation/util"
)

func testHostname(t *tap.T, hostname string) error {
	g, err := util.GetDefaultGenerator()
	if err != nil {
		return err
	}

	g.SetHostname(hostname)
	err = util.RuntimeInsideValidate(g, nil)
	t.Ok(err == nil, "hostname is set correctly")
	if err != nil {
		t.Diagnosticf("expect: err == nil, actual: err != nil")
	}

	return nil
}

func main() {
	t := tap.New()
	t.Header(0)
	defer t.AutoPlan()

	if "linux" != runtime.GOOS {
		t.Skip(1, fmt.Sprintf("linux-specific namespace test"))
	}

	hostnames := []string{
		"",
		"hostname-specific",
	}

	for _, h := range hostnames {
		if err := testHostname(t, h); err != nil {
			util.Fatal(err)
		}
	}
}
{'fraction_non_alphanumeric': 0.15739948674080412, 'fraction_numerical': 0.001710863986313088, 'mean_word_length': 3.875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1742851', 'n_tokens_mistral': 460, 'n_tokens_neox': 440, 'n_words': 98}