diff --git a/test/get-results.sh b/test/get-results.sh new file mode 100644 index 0000000000..355925ec65 --- /dev/null +++ b/test/get-results.sh @@ -0,0 +1,16 @@ +#!bin/bashtub + +source bin/bacalhau.sh + +testcase_can_get_results() { + # Assuming create_node is a function that takes two arguments separated by space, not comma + create_node requester,compute + + job_id=$(bacalhau job run --id-only $ROOT/testdata/jobs/docker-output.yaml) + bacalhau get $job_id > /dev/null 2>&1 + subject cat job-*/output_custom/output.txt + assert_equal 0 $status + assert_match "15" $(echo $stdout) + assert_equal '' $stderr + rm -rf job-${job_id%%-*} +} \ No newline at end of file diff --git a/test/hello-world-docker-v2.sh b/test/hello-world-docker-v2.sh new file mode 100644 index 0000000000..32badaeda9 --- /dev/null +++ b/test/hello-world-docker-v2.sh @@ -0,0 +1,13 @@ +#!bin/bashtub + +source bin/bacalhau.sh + +testcase_can_run_docker_hello_world() { + # Assuming create_node is a function that takes two arguments separated by comma, not space + create_node requester,compute + + subject bacalhau job run --follow $ROOT/testdata/jobs/docker-hello.yaml + assert_equal 0 $status + assert_match "Hello Bacalhau!" $(echo $stdout) + assert_equal '' $stderr +} \ No newline at end of file diff --git a/test/list_nodes.sh b/test/list_nodes.sh new file mode 100644 index 0000000000..407fda62c5 --- /dev/null +++ b/test/list_nodes.sh @@ -0,0 +1,12 @@ +#!bin/bashtub + +source bin/bacalhau.sh + +testcase_can_list_nodes_and_count() { + create_node requester,compute + + subject bacalhau node list --output json + assert_equal 0 $status + assert_match '1' $(echo $stdout | jq length) + assert_equal '' $stderr +} \ No newline at end of file diff --git a/testdata/jobs/docker-hello.yaml b/testdata/jobs/docker-hello.yaml new file mode 100644 index 0000000000..24bde0ea66 --- /dev/null +++ b/testdata/jobs/docker-hello.yaml @@ -0,0 +1,14 @@ +name: A Simple Docker Job +type: batch +count: 1 +tasks: + - name: My main task + engine: + type: docker + params: + Image: ubuntu:latest + Entrypoint: + - /bin/bash + Parameters: + - -c + - echo Hello Bacalhau! \ No newline at end of file