mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 04:16:46 +02:00
testing/cargo: fix test build-auth:http_auth_offered
This commit is contained in:
parent
654b9799cc
commit
fee46540e9
@ -21,7 +21,8 @@ subpackages="$pkgname-doc
|
||||
_ctarget="$CARCH-unknown-linux-musl"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/$pkgname/archive/$pkgver.tar.gz
|
||||
https://github.com/rust-lang/rust-installer/archive/$_installer_gitrev/rust-installer-$_installer_gitrev.tar.gz
|
||||
cargo-$_bootstrap_gitrev-$_ctarget.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_bootstrap_gitrev/cargo-nightly-$_ctarget.tar.gz"
|
||||
cargo-$_bootstrap_gitrev-$_ctarget.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_bootstrap_gitrev/cargo-nightly-$_ctarget.tar.gz
|
||||
fix-test-build-auth.patch"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_bootstrap_cargo="$srcdir/cargo-nightly-$_ctarget/cargo/bin/cargo"
|
||||
@ -102,4 +103,5 @@ _mv() {
|
||||
|
||||
sha512sums="5ea9a382ab48ee714b5cd1412f11ae72c6065913e2ce56cf84fe43f9061fd383f32c16a6525e5400f3fec9c10eaa3e7a149b026ae9c64af0955e91678b032650 cargo-0.17.0.tar.gz
|
||||
9ceb4755890ad3ae68ce141231c5114077261e0279d3a9a6208053f8d3386c9198e6b94d6321b456648dd5baa86dfc3ae81df44b67d41b428d11afd6763f0cff rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz
|
||||
4df33353b6be1af822220ca03f9ec5a3b6421c9b10ec17b864be586ba495c6210bac70d904b0e0b35eff62ef2c9a681ded526e5cbd37e326dc3146742aa659de cargo-6e0c18cccc8b0c06fba8a8d76486f81a792fb420-x86_64-unknown-linux-musl.tar.gz"
|
||||
4df33353b6be1af822220ca03f9ec5a3b6421c9b10ec17b864be586ba495c6210bac70d904b0e0b35eff62ef2c9a681ded526e5cbd37e326dc3146742aa659de cargo-6e0c18cccc8b0c06fba8a8d76486f81a792fb420-x86_64-unknown-linux-musl.tar.gz
|
||||
d93f6beeeb6b1207c38ee216f4a9475c7cc5cb11b52e3b52dbd3c4ad4ed5ca19118c1bc4a24c097aaa20e914e1c3d6a972fd438bae2db2d843319915dc4a3609 fix-test-build-auth.patch"
|
||||
|
||||
46
testing/cargo/fix-test-build-auth.patch
Normal file
46
testing/cargo/fix-test-build-auth.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From: Jakub Jirutka <jakub@jirutka.cz>
|
||||
Date: Thu, 13 Aug 2016 14:47:00 +0200
|
||||
Subject: [PATCH] Fix test build-auth:http_auth_offered
|
||||
|
||||
The test fails because of hard-coded libgit2 version, that may not be
|
||||
the same as actually used libgit2...
|
||||
|
||||
--- a/tests/build-auth.rs
|
||||
+++ b/tests/build-auth.rs
|
||||
@@ -20,7 +20,7 @@
|
||||
let addr = server.local_addr().unwrap();
|
||||
|
||||
fn headers(rdr: &mut BufRead) -> HashSet<String> {
|
||||
- let valid = ["GET", "Authorization", "Accept", "User-Agent"];
|
||||
+ let valid = ["GET", "Authorization", "Accept"];
|
||||
rdr.lines().map(|s| s.unwrap())
|
||||
.take_while(|s| s.len() > 2)
|
||||
.map(|s| s.trim().to_string())
|
||||
@@ -33,11 +33,6 @@
|
||||
let t = thread::spawn(move|| {
|
||||
let mut conn = BufStream::new(server.accept().unwrap().0);
|
||||
let req = headers(&mut conn);
|
||||
- let user_agent = if cfg!(windows) {
|
||||
- "User-Agent: git/1.0 (libgit2 0.25.0)"
|
||||
- } else {
|
||||
- "User-Agent: git/2.0 (libgit2 0.25.0)"
|
||||
- };
|
||||
conn.write_all(b"\
|
||||
HTTP/1.1 401 Unauthorized\r\n\
|
||||
WWW-Authenticate: Basic realm=\"wheee\"\r\n
|
||||
@@ -46,7 +41,6 @@
|
||||
assert_eq!(req, vec![
|
||||
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
||||
"Accept: */*",
|
||||
- user_agent,
|
||||
].into_iter().map(|s| s.to_string()).collect());
|
||||
drop(conn);
|
||||
|
||||
@@ -61,7 +55,6 @@
|
||||
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
||||
"Authorization: Basic Zm9vOmJhcg==",
|
||||
"Accept: */*",
|
||||
- user_agent,
|
||||
].into_iter().map(|s| s.to_string()).collect());
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user