Executes a named CUBRID shell testcase on the local machine and reports pass/fail. Invoke when the user asks to physically run a specific shell test — Korean: 돌려봐, 수행해줘, 실행해봐, 패스하는지 확인, 동작하는지 확인; English: "run", "execute", "shell tc". A CUBRID build URL in the request is a strong execution signal — always invoke this skill when a build URL appears alongside a test name or .sh path. Covers: checking if a newly written test works, verifying a test passes, and diagnosing a failing shell tc by actually running it. Skip for: reviewing or editing test code, creating new tests, adding to exclusion lists, full regression suites, CUBRID command questions without a specific test to run.
Run a single CTP shell testcase on the local machine, report the result, and analyze failures.
# Detect CTP_HOME: $CTP_HOME env var → $HOME/CTP → ~/cubrid-testtools/CTP (in order)
if [ -n "$CTP_HOME" ] && [ -f "$CTP_HOME/bin/ctp.sh" ]; then
echo "CTP found: $CTP_HOME"
elif [ -f "$HOME/CTP/bin/ctp.sh" ]; then
export CTP_HOME=$HOME/CTP
elif [ -f "$HOME/cubrid-testtools/CTP/bin/ctp.sh" ]; then
export CTP_HOME=$HOME/cubrid-testtools/CTP
else
echo "CTP not found"; exit 1
fi
# Verify shell helpers exist
ls $CTP_HOME/shell/init_path/init.sh
If ctp.sh or init.sh is not found, stop immediately and display:
"CTP is not installed. This skill cannot proceed. Install:
git clone https://github.com/CUBRID/cubrid-testtools.git && cp -rf cubrid-testtools/CTP ~/Reference: ~/cubrid-testtools/doc/ctp_install_guide.md"
The cubrid-testcases-private-ex repository containing test cases must also be present. CUBRID itself does not need to be pre-installed.
A build URL is required. If not provided, ask:
"A CUBRID build file URL is required. Please provide the build URL."
Install CUBRID and capture output for error checking:
sh ~/cubrid-testtools/CTP/common/script/run_cubrid_install <build_url> 2>&1 | tee /tmp/cubrid_install.log
Important: run_cubrid_install always returns 0 even on failure (prints [ERROR] instead) and removes $HOME/CUBRID before downloading. Verify by two checks:
# Check 1: Look for [ERROR] in install output
grep '\[ERROR\]' /tmp/cubrid_install.log
# Check 2: Verify CUBRID binary works
source ~/.cubrid.sh
cubrid --version
If either check fails, stop and show the [ERROR] lines from /tmp/cubrid_install.log. Ask the user to verify the URL.
Determine the full path to the .sh file. Shell testcases follow this structure:
{test_name}/cases/{test_name}.sh
If the user gives a partial path, CBRD issue number, or test name, locate the actual file:
find ~/cubrid-testcases-private-ex/shell -name "<pattern>.sh" -path "*/cases/*"
Read the script to understand what it tests, what databases/services it uses, and any special requirements (e.g., WINDOWS_NOT_SUPPORTED). This context is essential for diagnosing failures.
source ~/.cubrid.sh
export init_path=$HOME/cubrid-testtools/CTP/shell/init_path
Verify both cubrid --version and ls $init_path/init.sh succeed. If either fails, stop and report what is missing.
Run from the cases/ directory (tests use relative paths for helpers/answer files). Use timeout of 300s:
cd /path/to/test_name/cases/
timeout 300 sh test_name.sh 2>&1 | tee /tmp/shell_runone_output.log
EXIT_CODE=$?
Exit code 124 means timeout.
cat /path/to/test_name/cases/test_name.result
Result lines: test_name-1 : OK (pass) or test_name-1 : NOK (fail). Report each line.
Perform a systematic investigation to give the user an actionable diagnosis.
Review /tmp/shell_runone_output.log for CUBRID utility errors, csql errors, shell errors, or assertion failures (write_nok).
cat $CUBRID/log/server/*.err 2>/dev/null
ls -la $CUBRID/log/broker/*.err 2>/dev/null
ls -la /path/to/test_name/cases/core* 2>/dev/null
ls -la $CUBRID/core* 2>/dev/null
A core dump indicates a server crash.
If the test uses file-based comparison, diff the .answer file against the result file.
diff expected_file actual_file
Present the failure analysis:
After the test finishes, check for leftovers:
cubrid server status 2>/dev/null
ps -ef | grep cub_ | grep -v grep
If leftover processes or databases exist, warn the user and offer cleanup.
$CUBRID/log/server/*.err), or lock waits (cubrid lockdb).source ~/.cubrid.sh and export init_path=$HOME/cubrid-testtools/CTP/shell/init_path.chmod +x test_name.shinit test to init answer in the script).On success:
[PASS] test_name
- Result: test_name-1 : OK
- Summary: <what the test verified>
On failure:
[FAIL] test_name
- Result: test_name-1 : NOK
- Summary: <what the test verified>
- Failed at: <phase and command>
- Root cause: <diagnosis>
- Key logs:
<relevant error lines>
- Suggestion: <what to fix>