mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-22 17:35:55 +03:00
Merge pull request #3051 from cgwalters/rust-tests-update
rust/tests: Adjust for new ostree
This commit is contained in:
commit
cd606aa6fe
@ -43,14 +43,19 @@ echo $ED25519SECRET > ed25519.secret
|
|||||||
);
|
);
|
||||||
let s = Command::new("bash")
|
let s = Command::new("bash")
|
||||||
.env("G_TEST_SRCDIR", pwd)
|
.env("G_TEST_SRCDIR", pwd)
|
||||||
|
.env("OSTREE_HTTPD", "")
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.args(["-euo", "pipefail"])
|
.args(["-euo", "pipefail"])
|
||||||
.args(["-c", cmd.as_str()])
|
.args(["-c", cmd.as_str()])
|
||||||
.stdout(std::process::Stdio::null())
|
.stdout(std::process::Stdio::null())
|
||||||
.stderr(std::process::Stdio::null())
|
.stderr(std::process::Stdio::piped())
|
||||||
.status()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(s.success());
|
if !s.status.success() {
|
||||||
|
let mut stderr = std::io::stderr().lock();
|
||||||
|
let _ = std::io::copy(&mut std::io::Cursor::new(&s.stderr), &mut stderr);
|
||||||
|
panic!("failed to source libtest: {:?}", s.status);
|
||||||
|
}
|
||||||
|
|
||||||
let seckey = std::fs::read_to_string(path.join("ed25519.secret")).unwrap();
|
let seckey = std::fs::read_to_string(path.join("ed25519.secret")).unwrap();
|
||||||
let seckey = seckey.to_variant();
|
let seckey = seckey.to_variant();
|
||||||
@ -74,9 +79,7 @@ echo $ED25519SECRET > ed25519.secret
|
|||||||
let badsigs = [b"".as_slice()].to_variant();
|
let badsigs = [b"".as_slice()].to_variant();
|
||||||
|
|
||||||
let e = signer.data_verify(payload, &badsigs).err().unwrap();
|
let e = signer.data_verify(payload, &badsigs).err().unwrap();
|
||||||
assert!(e
|
assert!(e.to_string().contains("Ill-formed input"), "{}", e)
|
||||||
.to_string()
|
|
||||||
.contains("Invalid signature length of 0 bytes"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -25,11 +25,12 @@ else
|
|||||||
test_srcdir=$(dirname $0)
|
test_srcdir=$(dirname $0)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${G_TEST_BUILDDIR:-}" ]; then
|
top_builddir="${G_TEST_BUILDDIR:-}"
|
||||||
test_builddir="${G_TEST_BUILDDIR}/tests"
|
if test -z "${top_builddir}"; then
|
||||||
else
|
top_builddir=$(cd $(dirname $0)/.. && pwd)
|
||||||
test_builddir=$(dirname $0)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
test_builddir="${top_builddir}/tests"
|
||||||
. ${test_srcdir}/libtest-core.sh
|
. ${test_srcdir}/libtest-core.sh
|
||||||
|
|
||||||
# Make sure /sbin/capsh etc. are in our PATH even if non-root
|
# Make sure /sbin/capsh etc. are in our PATH even if non-root
|
||||||
@ -180,9 +181,11 @@ if test -n "${OT_TESTS_VALGRIND:-}"; then
|
|||||||
CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp"
|
CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OSTREE_HTTPD="${G_TEST_BUILDDIR}/ostree-trivial-httpd"
|
if test -z "${OSTREE_HTTPD:-}"; then
|
||||||
|
OSTREE_HTTPD="${top_builddir}/ostree-trivial-httpd"
|
||||||
if ! [ -x "${OSTREE_HTTPD}" ]; then
|
if ! [ -x "${OSTREE_HTTPD}" ]; then
|
||||||
fatal "Failed to find ${OSTREE_HTTPD}"
|
OSTREE_HTTPD=
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
files_are_hardlinked() {
|
files_are_hardlinked() {
|
||||||
|
@ -21,6 +21,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
setup_os_repository_signed () {
|
setup_os_repository_signed () {
|
||||||
mode=$1
|
mode=$1
|
||||||
shift
|
shift
|
||||||
|
@ -26,6 +26,11 @@ if ! has_gpgme; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "1..7"
|
echo "1..7"
|
||||||
|
|
||||||
keyid="472CDAFA"
|
keyid="472CDAFA"
|
||||||
|
@ -21,6 +21,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "1..2"
|
echo "1..2"
|
||||||
|
|
||||||
COMMIT_SIGN=""
|
COMMIT_SIGN=""
|
||||||
|
@ -21,6 +21,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
setup_fake_remote_repo1 "archive"
|
setup_fake_remote_repo1 "archive"
|
||||||
|
|
||||||
echo '1..9'
|
echo '1..9'
|
||||||
|
@ -21,6 +21,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "1..3"
|
echo "1..3"
|
||||||
|
|
||||||
setup_fake_remote_repo1 "archive"
|
setup_fake_remote_repo1 "archive"
|
||||||
|
@ -21,6 +21,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
if test -z "${OSTREE_HTTPD}"; then
|
||||||
|
echo "1..0 #SKIP no ostree-trivial-httpd"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
setup_fake_remote_repo1 "archive"
|
setup_fake_remote_repo1 "archive"
|
||||||
|
|
||||||
echo '1..1'
|
echo '1..1'
|
||||||
|
Loading…
Reference in New Issue
Block a user