mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 04:52:10 +00:00
add test
This commit is contained in:
parent
e9497cdcbc
commit
f06678ee6c
@ -0,0 +1,15 @@
|
||||
initial
|
||||
A C
|
||||
simple copy
|
||||
A C D
|
||||
node-A
|
||||
simple move
|
||||
A C H
|
||||
node-A
|
||||
move node with childs -- must be error
|
||||
Transaction failed (Not empty): Op #2, path: /test-keeper-client-cp-mv-commands/A
|
||||
A C H
|
||||
move node to existing
|
||||
Transaction failed (Node exists): Op #1, path: /test-keeper-client-cp-mv-commands/A
|
||||
A C H
|
||||
clean up
|
38
tests/queries/0_stateless/03230_keeper_cp_mv_commands.sh
Executable file
38
tests/queries/0_stateless/03230_keeper_cp_mv_commands.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
path="/test-keeper-client-cp-mv-commands"
|
||||
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "rm '$path'" >& /dev/null
|
||||
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path' 'root'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/A' 'node-A'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/A/B' 'node-B'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/C' 'node-B'"
|
||||
|
||||
echo 'initial'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
|
||||
|
||||
echo 'simple copy'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "cp '$path/A' '$path/D'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "get '$path/D'"
|
||||
|
||||
echo 'simple move'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/D' '$path/H'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "get '$path/H'"
|
||||
|
||||
echo 'move node with childs -- must be error'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/A' '$path/ERROR'" 2>&1
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
|
||||
|
||||
echo 'move node to existing'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/C' '$path/A'" 2>&1
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
|
||||
|
||||
echo 'clean up'
|
||||
$CLICKHOUSE_KEEPER_CLIENT -q "rmr '$path'"
|
Loading…
Reference in New Issue
Block a user