1// Copyright 2021 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build illumos
6// +build illumos
7
8package unix_test
9
10import (
11	"testing"
12
13	"golang.org/x/sys/unix"
14)
15
16func TestLifreqSetName(t *testing.T) {
17	var l unix.Lifreq
18	err := l.SetName("12345678901234356789012345678901234567890")
19	if err == nil {
20		t.Fatal(`Lifreq.SetName should reject names that are too long`)
21	}
22	err = l.SetName("tun0")
23	if err != nil {
24		t.Errorf(`Lifreq.SetName("tun0") failed: %v`, err)
25	}
26}
27