From 23b1a0ab70f190dbbb33dabb18ec039c7d85d6b3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 11 Jan 2020 23:51:49 +0300 Subject: Add implementation --- curl/tests/.gitignore | 4 ++++ curl/tests/build/.gitignore | 3 +++ curl/tests/build/bootstrap.build | 9 +++++++++ curl/tests/build/root.build | 16 ++++++++++++++++ curl/tests/buildfile | 5 +++++ curl/tests/empty.pem | 0 curl/tests/http.testscript | 10 ++++++++++ curl/tests/https.testscript | 22 ++++++++++++++++++++++ 8 files changed, 69 insertions(+) create mode 100644 curl/tests/.gitignore create mode 100644 curl/tests/build/.gitignore create mode 100644 curl/tests/build/bootstrap.build create mode 100644 curl/tests/build/root.build create mode 100644 curl/tests/buildfile create mode 100644 curl/tests/empty.pem create mode 100644 curl/tests/http.testscript create mode 100644 curl/tests/https.testscript (limited to 'curl/tests') diff --git a/curl/tests/.gitignore b/curl/tests/.gitignore new file mode 100644 index 0000000..ce6eed8 --- /dev/null +++ b/curl/tests/.gitignore @@ -0,0 +1,4 @@ +# Testscript output directories (can be symlinks). +# +test +test-* diff --git a/curl/tests/build/.gitignore b/curl/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/curl/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/curl/tests/build/bootstrap.build b/curl/tests/build/bootstrap.build new file mode 100644 index 0000000..d8bbf2c --- /dev/null +++ b/curl/tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : tests/build/bootstrap.build +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : cURL License; see accompanying COPYING file + +project = # Unnamed tests subproject. + +using config +using test +using dist diff --git a/curl/tests/build/root.build b/curl/tests/build/root.build new file mode 100644 index 0000000..2ea18e0 --- /dev/null +++ b/curl/tests/build/root.build @@ -0,0 +1,16 @@ +# file : tests/build/root.build +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : cURL License; see accompanying COPYING file + +# We need to configure C module to obtain the target information (see below). +# +using c + +# Setup the curl program that we are testing. +# +import curl = curl%exe{curl} +testscript{*}: test = $curl + +# Specify the test target for cross-testing. +# +test.target = $c.target diff --git a/curl/tests/buildfile b/curl/tests/buildfile new file mode 100644 index 0000000..3ad4988 --- /dev/null +++ b/curl/tests/buildfile @@ -0,0 +1,5 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : cURL License; see accompanying COPYING file + +./: testscript{*} file{empty.pem} $curl diff --git a/curl/tests/empty.pem b/curl/tests/empty.pem new file mode 100644 index 0000000..e69de29 diff --git a/curl/tests/http.testscript b/curl/tests/http.testscript new file mode 100644 index 0000000..98e7267 --- /dev/null +++ b/curl/tests/http.testscript @@ -0,0 +1,10 @@ +# file : tests/http.testscript +# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd +# license : cURL License; see accompanying COPYING file + +: basic +: +$* -sS 'http://www.example.com' >>~%EOO% +%% +%.+ +EOO diff --git a/curl/tests/https.testscript b/curl/tests/https.testscript new file mode 100644 index 0000000..ae621ac --- /dev/null +++ b/curl/tests/https.testscript @@ -0,0 +1,22 @@ +# file : tests/https.testscript +# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd +# license : cURL License; see accompanying COPYING file + +: default +: +{ + test.options += -sS + + $* 'http://www.example.com' | set s; + $* 'https://www.example.com' >"$s" +} + +: override +: +: Specify the empty CA certificates bundle on the command line and make sure +: curl exits with the 'peer certificate cannot be authenticated with known CA +: certificates' exit code. +: +{ + $* -s 'https://www.example.com' --capath "$src_base/empty.pem" == 60 +} -- cgit v1.1