installer: split up new env creation into chain of tasks
diff --git a/core/installer/tasks/dns_test.go b/core/installer/tasks/dns_test.go
new file mode 100644
index 0000000..270a495
--- /dev/null
+++ b/core/installer/tasks/dns_test.go
@@ -0,0 +1,33 @@
+package tasks
+
+import (
+ "context"
+ "net"
+ "testing"
+ "time"
+)
+
+func TestGoogle(t *testing.T) {
+ ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
+ d := NewDNSResolverTask(
+ "welcome.t5.lekva.me",
+ []net.IP{
+ net.ParseIP("135.181.48.180"),
+ net.ParseIP("65.108.39.172"),
+ },
+ ctx,
+ t.Logf,
+ )
+ d.FinalizeSubtasks()
+ ch := make(chan struct{})
+ d.OnDone(func(err error) {
+ if err != nil {
+ t.Logf("%s\n", err.Error())
+ } else {
+ t.Logf("Dooone")
+ }
+ ch <- struct{}{}
+ })
+ d.Start()
+ <-ch
+}