Skip to content

Commit

Permalink
review CLI LAUNCH scenarios and add negative test cases for extra arg…
Browse files Browse the repository at this point in the history
…uments
  • Loading branch information
KtorZ committed Oct 22, 2019
1 parent b26d9b9 commit 94cab4a
Showing 1 changed file with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ spec = do
withCreateProcess process $ \_ (Just o) (Just e) ph -> do
expectPathEventuallyExist d
expectPathEventuallyExist (d <> "/chain")
expectPathEventuallyExist (d <> "/jormungandr-config.yaml")
expectPathEventuallyExist (d <> "/wallets")
`finally` do
terminateProcess ph
Expand All @@ -118,7 +117,6 @@ spec = do
withCreateProcess process $ \_ (Just o) (Just e) ph -> do
expectPathEventuallyExist dir
expectPathEventuallyExist (dir <> "/chain")
expectPathEventuallyExist (dir <> "/jormungandr-config.yaml")
expectPathEventuallyExist (dir <> "/wallets")
`finally` do
terminateProcess ph
Expand Down Expand Up @@ -148,7 +146,32 @@ spec = do
]
(Exit c, Stdout o, Stderr _) <- cardanoWalletCLI @t args
c `shouldBe` ExitFailure 1
o `shouldContain` ("As far as I can tell, this isn't a valid block file: " <> secret)
o `shouldContain`
("As far as I can tell, this isn't a valid block file: " <> secret)

it "LAUNCH - Conflicting --rest-listen in extra arguments" $ do
let args =
[ "launch"
, "--genesis-block", block0
, "--"
, "--rest-listen", "127.0.0.1:8080"
]
(Exit c, Stdout _, Stderr e) <- cardanoWalletCLI @t args
c `shouldBe` ExitFailure 1
e `shouldContain`
"The --rest-listen argument is used by the launch command."

it "LAUNCH - Conflicting --storage in extra arguments" $ do
let args =
[ "launch"
, "--genesis-block", block0
, "--"
, "--storage", "/tmp/whatever"
]
(Exit c, Stdout _, Stderr e) <- cardanoWalletCLI @t args
c `shouldBe` ExitFailure 1
e `shouldContain`
"The --storage argument is used by the launch command."

it "LAUNCH - Restoration workers restart" $ withTempDir $ \d -> do
pendingWith
Expand Down

0 comments on commit 94cab4a

Please sign in to comment.