|
|
@@ -180,8 +180,8 @@ Fatal: could not decrypt key with given password
|
|
|
func TestUnlockFlag(t *testing.T) {
|
|
|
datadir := tmpDatadirWithKeystore(t)
|
|
|
geth := runGeth(t,
|
|
|
- "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "256", "--ipcdisable",
|
|
|
+ "--datadir", datadir, "--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
|
|
"js", "testdata/empty.js")
|
|
|
geth.Expect(`
|
|
|
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
|
|
|
@@ -204,8 +204,8 @@ Password: {{.InputLine "foobar"}}
|
|
|
func TestUnlockFlagWrongPassword(t *testing.T) {
|
|
|
datadir := tmpDatadirWithKeystore(t)
|
|
|
geth := runGeth(t,
|
|
|
- "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--datadir", datadir, "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
|
|
defer geth.ExpectExit()
|
|
|
geth.Expect(`
|
|
|
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1/3
|
|
|
@@ -223,9 +223,8 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could
|
|
|
func TestUnlockFlagMultiIndex(t *testing.T) {
|
|
|
datadir := tmpDatadirWithKeystore(t)
|
|
|
geth := runGeth(t,
|
|
|
- "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--unlock", "0,2",
|
|
|
- "js", "testdata/empty.js")
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--datadir", datadir, "--unlock", "0,2", "js", "testdata/empty.js")
|
|
|
geth.Expect(`
|
|
|
Unlocking account 0 | Attempt 1/3
|
|
|
!! Unsupported terminal, password will be echoed.
|
|
|
@@ -250,8 +249,8 @@ Password: {{.InputLine "foobar"}}
|
|
|
func TestUnlockFlagPasswordFile(t *testing.T) {
|
|
|
datadir := tmpDatadirWithKeystore(t)
|
|
|
geth := runGeth(t,
|
|
|
- "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--password", "testdata/passwords.txt", "--unlock", "0,2",
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--datadir", datadir, "--password", "testdata/passwords.txt", "--unlock", "0,2",
|
|
|
"js", "testdata/empty.js")
|
|
|
geth.ExpectExit()
|
|
|
|
|
|
@@ -270,8 +269,8 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
|
|
|
func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
|
|
|
datadir := tmpDatadirWithKeystore(t)
|
|
|
geth := runGeth(t,
|
|
|
- "--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--password", "testdata/wrong-passwords.txt", "--unlock", "0,2")
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--datadir", datadir, "--password", "testdata/wrong-passwords.txt", "--unlock", "0,2")
|
|
|
defer geth.ExpectExit()
|
|
|
geth.Expect(`
|
|
|
Fatal: Failed to unlock account 0 (could not decrypt key with given password)
|
|
|
@@ -281,8 +280,8 @@ Fatal: Failed to unlock account 0 (could not decrypt key with given password)
|
|
|
func TestUnlockFlagAmbiguous(t *testing.T) {
|
|
|
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
|
|
|
geth := runGeth(t,
|
|
|
- "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--keystore", store, "--unlock", "f466859ead1932d743d622cb74fc058882e8648a",
|
|
|
"js", "testdata/empty.js")
|
|
|
defer geth.ExpectExit()
|
|
|
|
|
|
@@ -319,8 +318,8 @@ In order to avoid this warning, you need to remove the following duplicate key f
|
|
|
func TestUnlockFlagAmbiguousWrongPassword(t *testing.T) {
|
|
|
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
|
|
|
geth := runGeth(t,
|
|
|
- "--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
|
|
|
- "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
|
|
+ "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0", "--nousb", "--cache", "128", "--ipcdisable",
|
|
|
+ "--keystore", store, "--unlock", "f466859ead1932d743d622cb74fc058882e8648a")
|
|
|
defer geth.ExpectExit()
|
|
|
|
|
|
// Helper for the expect template, returns absolute keystore path.
|