forked from TrueCloudLab/frostfs-node
[#750] adm: Fix invalid tests
Introduced in a9d04ba86f
.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
dump-police
parent
fe1acf9e9a
commit
efb37b0e65
|
@ -20,7 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
contractsPath = "../../../../../../frostfs-contract/frostfs-contract-v0.16.0.tar.gz"
|
contractsPath = "../../../../../../contract/frostfs-contract-v0.18.0.tar.gz"
|
||||||
protoFileName = "proto.yml"
|
protoFileName = "proto.yml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -58,7 +58,9 @@ func testInitialize(t *testing.T, committeeSize int) {
|
||||||
|
|
||||||
// Set to the path or remove the next statement to download from the network.
|
// Set to the path or remove the next statement to download from the network.
|
||||||
require.NoError(t, initCmd.Flags().Set(contractsInitFlag, contractsPath))
|
require.NoError(t, initCmd.Flags().Set(contractsInitFlag, contractsPath))
|
||||||
v.Set(localDumpFlag, filepath.Join(testdataDir, "out"))
|
|
||||||
|
dumpPath := filepath.Join(testdataDir, "out")
|
||||||
|
require.NoError(t, initCmd.Flags().Set(localDumpFlag, dumpPath))
|
||||||
v.Set(alphabetWalletsFlag, testdataDir)
|
v.Set(alphabetWalletsFlag, testdataDir)
|
||||||
v.Set(epochDurationInitFlag, 1)
|
v.Set(epochDurationInitFlag, 1)
|
||||||
v.Set(maxObjectSizeInitFlag, 1024)
|
v.Set(maxObjectSizeInitFlag, 1024)
|
||||||
|
@ -67,12 +69,15 @@ func testInitialize(t *testing.T, committeeSize int) {
|
||||||
require.NoError(t, initializeSideChainCmd(initCmd, nil))
|
require.NoError(t, initializeSideChainCmd(initCmd, nil))
|
||||||
|
|
||||||
t.Run("force-new-epoch", func(t *testing.T) {
|
t.Run("force-new-epoch", func(t *testing.T) {
|
||||||
|
require.NoError(t, forceNewEpoch.Flags().Set(localDumpFlag, dumpPath))
|
||||||
require.NoError(t, forceNewEpochCmd(forceNewEpoch, nil))
|
require.NoError(t, forceNewEpochCmd(forceNewEpoch, nil))
|
||||||
})
|
})
|
||||||
t.Run("set-config", func(t *testing.T) {
|
t.Run("set-config", func(t *testing.T) {
|
||||||
|
require.NoError(t, setConfig.Flags().Set(localDumpFlag, dumpPath))
|
||||||
require.NoError(t, setConfigCmd(setConfig, []string{"MaintenanceModeAllowed=true"}))
|
require.NoError(t, setConfigCmd(setConfig, []string{"MaintenanceModeAllowed=true"}))
|
||||||
})
|
})
|
||||||
t.Run("set-policy", func(t *testing.T) {
|
t.Run("set-policy", func(t *testing.T) {
|
||||||
|
require.NoError(t, setPolicy.Flags().Set(localDumpFlag, dumpPath))
|
||||||
require.NoError(t, setPolicyCmd(setPolicy, []string{"ExecFeeFactor=1"}))
|
require.NoError(t, setPolicyCmd(setPolicy, []string{"ExecFeeFactor=1"}))
|
||||||
})
|
})
|
||||||
t.Run("remove-node", func(t *testing.T) {
|
t.Run("remove-node", func(t *testing.T) {
|
||||||
|
@ -80,6 +85,7 @@ func testInitialize(t *testing.T, committeeSize int) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
pub := hex.EncodeToString(pk.PublicKey().Bytes())
|
pub := hex.EncodeToString(pk.PublicKey().Bytes())
|
||||||
|
require.NoError(t, removeNodes.Flags().Set(localDumpFlag, dumpPath))
|
||||||
require.NoError(t, removeNodesCmd(removeNodes, []string{pub}))
|
require.NoError(t, removeNodesCmd(removeNodes, []string{pub}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,6 +320,7 @@ func initSetConfigCmd() {
|
||||||
setConfig.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
setConfig.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
||||||
setConfig.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
setConfig.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
||||||
|
setConfig.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initDumpNetworkConfigCmd() {
|
func initDumpNetworkConfigCmd() {
|
||||||
|
@ -337,18 +338,21 @@ func initSetPolicyCmd() {
|
||||||
RootCmd.AddCommand(setPolicy)
|
RootCmd.AddCommand(setPolicy)
|
||||||
setPolicy.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
setPolicy.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
||||||
setPolicy.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
setPolicy.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
setPolicy.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initRemoveNodesCmd() {
|
func initRemoveNodesCmd() {
|
||||||
RootCmd.AddCommand(removeNodes)
|
RootCmd.AddCommand(removeNodes)
|
||||||
removeNodes.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
removeNodes.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
||||||
removeNodes.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
removeNodes.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
removeNodes.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initForceNewEpochCmd() {
|
func initForceNewEpochCmd() {
|
||||||
RootCmd.AddCommand(forceNewEpoch)
|
RootCmd.AddCommand(forceNewEpoch)
|
||||||
forceNewEpoch.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
forceNewEpoch.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
||||||
forceNewEpoch.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
forceNewEpoch.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
forceNewEpoch.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initGenerateStorageCmd() {
|
func initGenerateStorageCmd() {
|
||||||
|
|
Loading…
Reference in New Issue