diff --git a/src/lua/admin.cc b/src/lua/admin.cc index fec613660cdaea2aaf883396d7dfb646b41fde71..28728e5f9b3cde7de36a2a83ce7b2d6cb59b379d 100644 --- a/src/lua/admin.cc +++ b/src/lua/admin.cc @@ -60,7 +60,8 @@ static int lbox_save_coredump(struct lua_State *L __attribute__((unused))) { coredump(60); - return 0; + lua_pushstring(L, "ok"); + return 1; } static int diff --git a/test/box/admin.result b/test/box/admin.result index 7035da227c9be47ae7656c8c0cb8cb828adf0190..e813b4ae39a4d0e1e2eb902312a0903de43e4b54 100644 --- a/test/box/admin.result +++ b/test/box/admin.result @@ -1,111 +1,128 @@ -exit -show stat +box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum') --- -statistics: - REPLACE: { rps: 0 , total: 0 } - SELECT: { rps: 0 , total: 0 } - UPDATE: { rps: 0 , total: 0 } - DELETE_1_3: { rps: 0 , total: 0 } - DELETE: { rps: 0 , total: 0 } - CALL: { rps: 0 , total: 0 } +- [0, 0, 'tweedledum'] ... -help +box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'num') --- -available commands: - - help - - exit - - show info - - show fiber - - show configuration - - show slab - - show palloc - - show stat - - show plugins - - save coredump - - save snapshot - - lua command - - reload configuration - - show injections (debug mode only) - - set injection <name> <state> (debug mode only) +- [0, 0, 'primary', 1752392040, 1, 1, 0, 'num'] ... -show configuration +box.stat() --- -configuration: - username: (null) - local_hot_standby: "false" - bind_ipaddr: "INADDR_ANY" - coredump: "false" - admin_port: "33015" - replication_port: "0" - log_level: "4" - slab_alloc_arena: "0.1" - slab_alloc_minimal: "64" - slab_alloc_factor: "2" - work_dir: (null) - snap_dir: "." - wal_dir: "." - script_dir: "." - pid_file: "box.pid" - logger: "cat - >> tarantool.log" - logger_nonblock: "true" - io_collect_interval: "0" - backlog: "1024" - readahead: "16320" - snap_io_rate_limit: "0" - rows_per_wal: "50" - wal_writer_inbox_size: "16384" - wal_mode: "fsync_delay" - wal_fsync_delay: "0" - wal_dir_rescan_delay: "0.1" - panic_on_snap_error: "true" - panic_on_wal_error: "false" - primary_port: "33013" - secondary_port: "33014" - too_long_threshold: "0.5" - custom_proc_title: (null) - memcached_port: "0" - memcached_space: "23" - memcached_expire: "false" - memcached_expire_per_loop: "1024" - memcached_expire_full_sweep: "3600" - replication_source: (null) - space[0].enabled: "true" - space[0].arity: "-1" - space[0].estimated_rows: "0" - space[0].index[0].type: "HASH" - space[0].index[0].unique: "true" - space[0].index[0].key_field[0].fieldno: "0" - space[0].index[0].key_field[0].type: "NUM" +- DELETE: + total: 0 + rps: 0 + SELECT: + total: 0 + rps: 0 + REPLACE: + total: 2 + rps: 0 + CALL: + total: 0 + rps: 0 + UPDATE: + total: 0 + rps: 0 + DELETE_1_3: + total: 0 + rps: 0 ... -show stat +help() --- -statistics: - REPLACE: { rps: 0 , total: 0 } - SELECT: { rps: 0 , total: 0 } - UPDATE: { rps: 0 , total: 0 } - DELETE_1_3: { rps: 0 , total: 0 } - DELETE: { rps: 0 , total: 0 } - CALL: { rps: 0 , total: 0 } +- server admin commands +- - box.snapshot() + - box.info() + - box.stat() + - box.slab.info() + - box.slab.check() + - box.fiber.info() + - box.plugin.info() + - box.cfg() + - box.cfg_reload() + - box.coredump() +... +box.cfg() +--- +- io_collect_interval: 0 + pid_file: box.pid + slab_alloc_minimal: 64 + slab_alloc_arena: 0.1 + log_level: 4 + logger_nonblock: true + memcached_expire_per_loop: 1024 + snap_dir: . + coredump: false + panic_on_snap_error: true + memcached_expire_full_sweep: 3600 + replication_port: 0 + wal_fsync_delay: 0 + too_long_threshold: 0.5 + slab_alloc_factor: 2 + admin_port: 33015 + logger: cat - >> tarantool.log + snap_io_rate_limit: 0 + wal_dir_rescan_delay: 0.1 + backlog: 1024 + secondary_port: 33014 + wal_dir: . + local_hot_standby: false + wal_mode: fsync_delay + rows_per_wal: 50 + readahead: 16320 + panic_on_wal_error: false + script_dir: . + primary_port: 33013 + bind_ipaddr: INADDR_ANY + memcached_port: 0 + memcached_space: 23 + memcached_expire: false +... +box.stat() +--- +- DELETE: + total: 0 + rps: 0 + SELECT: + total: 0 + rps: 0 + REPLACE: + total: 2 + rps: 0 + CALL: + total: 0 + rps: 0 + UPDATE: + total: 0 + rps: 0 + DELETE_1_3: + total: 0 + rps: 0 ... insert into t0 values (1, 'tuple') Insert OK, 1 row affected -save snapshot +box.snapshot() --- -ok +- ok ... delete from t0 where k0 = 1 Delete OK, 1 row affected -show info +box.info() --- -info: - version: "1.minor.patch-<rev>-<commit>" - uptime: <uptime> +- version: 1.minor.patch-<rev>-<commit> + status: primary pid: <pid> - logger_pid: <pid> + lsn: 5 snapshot_pid: <pid> - lsn: 3 - recovery_lag: 0.000 - recovery_last_update: 0.000 - status: primary - config: "tarantool.cfg" + recovery_last_update: 0 + recovery_lag: 0 + uptime: <uptime> + build: + flags: ' -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables + -std=c11 -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing -Werror -pthread' + target: Linux-i686-Debug + compiler: /usr/bin/gcc /usr/bin/c++ + options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_STATIC=OFF -DENABLE_TRACE=ON + -DENABLE_BACKTRACE=ON -DENABLE_CLIENT=ON + logger_pid: <pid> + config: tarantool.cfg ... diff --git a/test/box/admin.test.py b/test/box/admin.test.py index 8f51c96681cf236ff7ee5e9f9b06cae221ba9166..c919eae82b512cf1447b593814cd6e76b049a616 100644 --- a/test/box/admin.test.py +++ b/test/box/admin.test.py @@ -1,16 +1,20 @@ # encoding: utf-8 # import sys + # clear statistics: server.stop() server.deploy() -admin("exit") -admin("show stat") -admin("help") -admin("show configuration") -admin("show stat") + +admin("box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')") +admin("box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'num')") + +admin("box.stat()") +admin("help()") +admin("box.cfg()") +admin("box.stat()") sql("insert into t0 values (1, 'tuple')") -admin("save snapshot") +admin("box.snapshot()") sql("delete from t0 where k0 = 1") sys.stdout.push_filter("(\d)\.\d\.\d(-\d+-\w+)?", "\\1.minor.patch-<rev>-<commit>") sys.stdout.push_filter("pid: \d+", "pid: <pid>") @@ -18,14 +22,14 @@ sys.stdout.push_filter("logger_pid: \d+", "pid: <pid>") sys.stdout.push_filter("uptime: \d+", "uptime: <uptime>") sys.stdout.push_filter("uptime: \d+", "uptime: <uptime>") sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool") -admin("show info") +admin("box.info()") sys.stdout.clear_all_filters() sys.stdout.push_filter(".*", "") -admin("show fiber") -admin("show slab") -admin("show palloc") - +admin("box.fiber.info()") +admin("box.slab.info()") sys.stdout.clear_all_filters() +admin("box.space[0]:drop()") + # vim: syntax=python diff --git a/test/box/admin_coredump.result b/test/box/admin_coredump.result index 985c517cb2fea489bff4f996e05fa332bd8fdd38..a0bbad699be6bbf0015d498b1a105d88f7f6d8f5 100644 --- a/test/box/admin_coredump.result +++ b/test/box/admin_coredump.result @@ -1,7 +1,7 @@ -- moved to separate test because this test fail in the valgrind mode (coredump -- process terminated via abort procedure) -save coredump +box.coredump() --- -ok +- ok ... -- vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 syntax=lua diff --git a/test/box/admin_coredump.test.lua b/test/box/admin_coredump.test.lua index 2311f2825a76984f9e5200edc3b5fe6981802028..2ed987b058172a3cd78abf8be1f53f7b29d67f1b 100644 --- a/test/box/admin_coredump.test.lua +++ b/test/box/admin_coredump.test.lua @@ -1,4 +1,4 @@ -- moved to separate test because this test fail in the valgrind mode (coredump -- process terminated via abort procedure) -save coredump +box.coredump() -- vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 syntax=lua