| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func TestSystemNameState(t *testing.T) { |
| dir, err := ioutil.TempDir("", "instance") |
| t.Fatalf("Failed to create temp dir: %v", err) |
| expected := "vanadium-user" |
| if err := saveSystemNameForInstance(dir, expected); err != nil { |
| t.Fatalf("saveSystemNameForInstance(%v, %v) failed: %v", dir, expected, err) |
| got, err := readSystemNameForInstance(dir) |
| t.Fatalf("readSystemNameForInstance(%v) failed: ", err) |
| t.Fatalf("got %v, expected %v", got, expected) |