<commit_before>// Copyright 2020 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package host

import (
	"bufio"
	"bytes"
	"fmt"
	"runtime"
	"strings"
	"testing"

	"github.com/google/syzkaller/sys/targets"
)

func TestReadCPUInfoLinux(t *testing.T) {
	buf := new(bytes.Buffer)
	if err := readCPUInfo(buf); err != nil {<commit_msg>pkg/host: add TestCollectMachineInfo<commit_after>// Copyright 2020 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package host

import (
	"bufio"
	"bytes"
	"fmt"
	"runtime"
	"strings"
	"testing"

	"github.com/google/syzkaller/sys/targets"
)

func TestCollectMachineInfo(t *testing.T) {
	info, err := CollectMachineInfo()
	if err != nil {
		t.Fatal(err)
	}
	t.Logf("machine info:\n%s", info)
}

func TestReadCPUInfoLinux(t *testing.T) {
	buf := new(bytes.Buffer)
	if err := readCPUInfo(buf); err != nil {
{'fraction_non_alphanumeric': 0.12294288480154889, 'fraction_numerical': 0.00968054211035818, 'mean_word_length': 4.222222222222222, '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': '230202', 'n_tokens_mistral': 372, 'n_tokens_neox': 357, 'n_words': 111}