// TestSubmitCommand tests that client.SubmitCommand(...) adds a command
// to the proper node path in etcd, and that it can be read back.
TestSubmitCommand tests that client.SubmitCommand(...) adds a command
to the proper node path in etcd, and that it can be read back.
// TestSubmitCommand tests that client . SubmitCommand ( ... ) adds a command // to the proper node path in etcd and that it can be read back .
func TestSubmitCommand(t *testing.T) {
	eclient := testutil.NewEtcdV3Client(t)
	kvc := etcdv3.NewKV(eclient)
	mclient := NewClient(Namespace, eclient)
	if err := mclient.SubmitCommand(Node1, metafora.CommandFreeze()); err != nil {
		t.Fatalf("Unable to submit command.   error:%v", err)
	}
	if res, err := kvc.Get(context.Background(), NodesDir, etcdv3.WithPrefix()); err != nil {
		t.Fatalf("Get on path %v returned error: %v", NodesDir, err)
	} else if res.Count == 0 {
		t.Fatalf("Get on path %v returned nil for child nodes", NodesDir)
	}
}
func TestSubmitCommand ( t * testing . T ) { eclient := testutil . NewEtcdV3Client ( t ) kvc := etcdv3 . NewKV ( eclient ) mclient := NewClient ( Namespace , eclient ) if err := mclient . SubmitCommand ( Node1 , metafora . CommandFreeze ( ) ) ; err != nil { t . Fatalf ( " " , err ) } if res , err := kvc . Get ( context . Background ( ) , NodesDir , etcdv3 . WithPrefix ( ) ) ; err != nil { t . Fatalf ( " " , NodesDir , err ) } else if res . Count == 0 { t . Fatalf ( " " , NodesDir ) } }
TestSubmitCommand tests that client.SubmitCommand(...) adds a command
to the proper node path in etcd, and that it can be read back.
TestSubmitCommand tests that client . SubmitCommand ( ... ) adds a command to the proper node path in etcd and that it can be read back .