2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-11-16 18:04:01 +00:00
|
|
|
//go:build linux
|
|
|
|
// +build linux
|
2019-08-27 21:16:41 +00:00
|
|
|
|
|
|
|
package freeport
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetEphemeralPortRange(t *testing.T) {
|
|
|
|
min, max, err := getEphemeralPortRange()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %v", err)
|
|
|
|
}
|
|
|
|
if min <= 0 || max <= 0 || min > max {
|
|
|
|
t.Fatalf("unexpected values: min=%d, max=%d", min, max)
|
|
|
|
}
|
|
|
|
t.Logf("min=%d, max=%d", min, max)
|
|
|
|
}
|