summaryrefslogtreecommitdiff
path: root/tests/vercheck
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-12 20:18:41 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-23 21:51:25 +0100
commitb15c31bdf47c2db5d95049090a5fd099ae1c1e02 (patch)
treed906f59048dd218490467594358432df6b3a8494 /tests/vercheck
parentb3453bbea901ed02ce3b458883f2f8ab03afc161 (diff)
[feat] simple update check
Diffstat (limited to 'tests/vercheck')
-rw-r--r--tests/vercheck/.gitignore1
-rw-r--r--tests/vercheck/main.go18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/vercheck/.gitignore b/tests/vercheck/.gitignore
new file mode 100644
index 0000000..f734c59
--- /dev/null
+++ b/tests/vercheck/.gitignore
@@ -0,0 +1 @@
+vercheck
diff --git a/tests/vercheck/main.go b/tests/vercheck/main.go
new file mode 100644
index 0000000..bc8e04e
--- /dev/null
+++ b/tests/vercheck/main.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "0xacab.org/leap/bitmask-vpn/pkg/config/version"
+ "fmt"
+)
+
+func main() {
+ fmt.Println("Testing version upgrade (checks network)")
+ fmt.Println("-> set DEBUG=1 for details")
+ u := version.CanUpgrade()
+ switch {
+ case u:
+ fmt.Println("can upgrade")
+ case !u:
+ fmt.Println("no new version available")
+ }
+}