mirror of https://github.com/tailscale/tailscale/
Revert "control/controlclient: use API to get Windows version number"
This reverts commit 4224b3f731
.
From https://github.com/tailscale/tailscale/pull/1494#discussion_r594852889 ...
> Actually, I want all four numbers back. I spent the evening
> debugging an issue for a user running an old version of Windows
> and then going to to
> https://en.wikipedia.org/wiki/Windows_10_version_history_(version_1809)
> and reading all the revision notes in the footnotes of that wikipedia
> page.
>
> I'm going to revert this for now for Tailscale 1.6. We can land it
> again later when we figure out how to get the fourth numbers.
Updates #1478
pull/1397/head
parent
d42f8b7f9a
commit
1d7f9d5b4a
@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package controlclient
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestOsVersionWindows(t *testing.T) {
|
||||
out, err := exec.Command("cmd", "/c", "ver").Output()
|
||||
if err != nil {
|
||||
t.Fatalf("`ver` error: %v", err)
|
||||
}
|
||||
// Extract the version number from the output, and isolate the first three parts (major.minor.build)
|
||||
rx := regexp.MustCompile(`(\d+\.\d+\.\d+)(\.\d+)?`)
|
||||
m := rx.FindStringSubmatch(string(out))
|
||||
if m == nil {
|
||||
t.Fatalf("no version number in `ver` output: %q", out)
|
||||
}
|
||||
got := osVersionWindows()
|
||||
if m[1] != got {
|
||||
t.Errorf("osVersionWindows got %q want %q", got, m[1])
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue