-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sg integrationtest add aws-kms, and simple cli (#365)
* sg-integrationtest-includebaker add baking operations to allow policy test * sg-integrationtest add block operation * sg-integrationtest add aws kms test and simple signatory-cli test * sg-integrationtest missed workflow changes last commit * sg-integrationtest revert config file * sg-integrationtest improve readme * sg-integrationtest fix aws vault test * sg-integrationtest add to gitignore integration_test stuffs
- Loading branch information
1 parent
86d02c9
commit 2cd924f
Showing
20 changed files
with
179 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export OCTEZ_VERSION=amd64_v16.0-rc3 | ||
export PROTOCOL=Mumbai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export OCTEZ_VERSION=arm64_v16.0-rc3 | ||
export PROTOCOL=Mumbai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export OCTEZ_VERSION=amd64_v17.0-beta1 | ||
export PROTOCOL=Nairobi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export OCTEZ_VERSION=arm64_v17.0-beta1 | ||
export PROTOCOL=Nairobi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export VAULT_AWS_USER=${{ secrets.INTEGRATIONTEST_VAULT_AWS_USER }} | ||
export VAULT_AWS_KEY=${{ secrets.INTEGRATIONTEST_VAULT_AWS_KEY }} | ||
export VAULT_AWS_SECRET=${{ secrets.INTEGRATIONTEST_VAULT_AWS_SECRET }} | ||
export VAULT_AWS_REGION=${{ secrets.INTEGRATIONTEST_VAULT_AWS_REGION }} | ||
export VAULT_AWS_PKH_TZ2=${{ secrets.INTEGRATIONTEST_VAULT_AWS_TZ2 }} | ||
export VAULT_AWS_PKH_TZ3=${{ secrets.INTEGRATIONTEST_VAULT_AWS_TZ3 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package integrationtest | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestCliList(t *testing.T) { | ||
var c Config | ||
c.Read() | ||
|
||
out, err := SignatoryCli("list") | ||
assert.Nil(t, err) | ||
require.Contains(t, string(out), "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package integrationtest | ||
|
||
import ( | ||
"os/exec" | ||
) | ||
|
||
func SignatoryCli(arg ...string) ([]byte, error) { | ||
var cmd = "docker" | ||
var args = []string{"exec", "signatory", "signatory-cli"} | ||
args = append(args, arg...) | ||
return exec.Command(cmd, args...).CombinedOutput() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package integrationtest | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestAWSVault(t *testing.T) { | ||
|
||
tz2 := os.Getenv("VAULT_AWS_PKH_TZ2") | ||
tz3 := os.Getenv("VAULT_AWS_PKH_TZ3") | ||
user := os.Getenv("VAULT_AWS_USER") | ||
key := os.Getenv("VAULT_AWS_KEY") | ||
secret := os.Getenv("VAULT_AWS_SECRET") | ||
region := os.Getenv("VAULT_AWS_REGION") | ||
|
||
tz2alias := "awstz2" | ||
tz3alias := "awstz3" | ||
|
||
//config | ||
var c Config | ||
c.Read() | ||
var v VaultConfig | ||
v.Driver = "awskms" | ||
v.Conf = map[string]*string{"user_name": &user, "access_key_id": &key, "secret_access_key": &secret, "region": ®ion} | ||
c.Vaults["aws"] = &v | ||
var p TezosPolicy | ||
p.LogPayloads = true | ||
p.Allow = map[string][]string{"generic": {"reveal", "transaction"}} | ||
c.Tezos[tz2] = &p | ||
c.Tezos[tz3] = &p | ||
backup_then_update_config(c) | ||
defer restore_config() | ||
restart_signatory() | ||
|
||
//setup | ||
out, err := OctezClient("import", "secret", "key", tz2alias, "http://signatory:6732/"+tz2) | ||
assert.NoError(t, err) | ||
assert.Contains(t, string(out), "Tezos address added: "+tz2) | ||
defer OctezClient("forget", "address", tz2alias, "--force") | ||
|
||
out, err = OctezClient("import", "secret", "key", tz3alias, "http://signatory:6732/"+tz3) | ||
assert.NoError(t, err) | ||
assert.Contains(t, string(out), "Tezos address added: "+tz3) | ||
defer OctezClient("forget", "address", tz3alias, "--force") | ||
|
||
out, err = OctezClient("transfer", "100", "from", "alice", "to", tz2alias, "--burn-cap", "0.06425") | ||
assert.NoError(t, err) | ||
require.Contains(t, string(out), "Operation successfully injected in the node") | ||
|
||
out, err = OctezClient("transfer", "100", "from", "alice", "to", tz3alias, "--burn-cap", "0.06425") | ||
assert.NoError(t, err) | ||
require.Contains(t, string(out), "Operation successfully injected in the node") | ||
|
||
//test | ||
//TODO: resolve issue #364 and enable the tz2 test | ||
//out, err = OctezClient("transfer", "1", "from", tz2alias, "to", "alice", "--burn-cap", "0.06425") | ||
//assert.NoError(t, err) | ||
//require.Contains(t, string(out), "Operation successfully injected in the node") | ||
|
||
out, err = OctezClient("transfer", "1", "from", tz3alias, "to", "alice", "--burn-cap", "0.06425") | ||
assert.NoError(t, err) | ||
require.Contains(t, string(out), "Operation successfully injected in the node") | ||
} |