tests: Migrate Txn tests to common functional test framework

This commit is contained in:
Vimal Kumar
2022-05-11 10:29:57 +05:30
parent 066e510731
commit 55f0c96fa0
13 changed files with 418 additions and 84 deletions

View File

@ -23,7 +23,7 @@ import (
"strings"
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/client/v3"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/cobrautl"
"github.com/spf13/cobra"
@ -85,7 +85,7 @@ func readCompares(r *bufio.Reader) (cmps []clientv3.Cmp) {
break
}
cmp, err := parseCompare(line)
cmp, err := ParseCompare(line)
if err != nil {
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
}
@ -119,7 +119,7 @@ func readOps(r *bufio.Reader) (ops []clientv3.Op) {
}
func parseRequestUnion(line string) (*clientv3.Op, error) {
args := argify(line)
args := Argify(line)
if len(args) < 2 {
return nil, fmt.Errorf("invalid txn compare request: %s", line)
}
@ -153,7 +153,7 @@ func parseRequestUnion(line string) (*clientv3.Op, error) {
return &op, nil
}
func parseCompare(line string) (*clientv3.Cmp, error) {
func ParseCompare(line string) (*clientv3.Cmp, error) {
var (
key string
op string