aboutsummaryrefslogtreecommitdiffstats
path: root/device_test.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--device_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/device_test.go b/device_test.go
new file mode 100644
index 0000000..abd0208
--- /dev/null
+++ b/device_test.go
@@ -0,0 +1,43 @@
+package main
+
+/* Create two device instances and simulate full WireGuard interaction
+ * without network dependencies
+ */
+
+import "testing"
+
+func TestDevice(t *testing.T) {
+
+ // prepare tun devices for generating traffic
+
+ tun1, err := CreateDummyTUN("tun1")
+ if err != nil {
+ t.Error("failed to create tun:", err.Error())
+ }
+
+ tun2, err := CreateDummyTUN("tun2")
+ if err != nil {
+ t.Error("failed to create tun:", err.Error())
+ }
+
+ println(tun1)
+ println(tun2)
+
+ // prepare endpoints
+
+ end1, err := CreateDummyEndpoint()
+ if err != nil {
+ t.Error("failed to create endpoint:", err.Error())
+ }
+
+ end2, err := CreateDummyEndpoint()
+ if err != nil {
+ t.Error("failed to create endpoint:", err.Error())
+ }
+
+ println(end1)
+ println(end2)
+
+ // create binds
+
+}