#!/bin/bash
set -eu

TESTDIR=$(readlink -f $(dirname $0))

case "$APT_TEST_METHOD" in
	cdrom*)
		echo 'SKIP (not ready for apt-cdrom, because it fetches the lists earlier)' >&2
		exit 0
		;;
	http*) :
	       ;;
	*)
	    # in our setup...
		echo 'SKIP (other methods do not seem to fetch the compressed list...)' >&2
		exit 0
	       ;;
esac

. $TESTDIR/framework

setupenvironment

buildpackage 'simple-package'
buildpackage 'simple-package-noarch'
buildpackage 'conflicting-package-one'
buildpackage 'conflicting-package-two'

generaterepository_and_switch_sources "$TMPWORKINGDIRECTORY/usr/src/RPM/RPMS"

# Inject (if bad, apt-get update should fail or refetch/retry):
readonly REPO_NOARCH_PKGLIST="$REPO_STORAGE/$NOARCH_DISTRO/base/pkglist.$DISTRO_COMPONENT$REPO_COMPR_EXT"
{
    head -c-1 "$REPO_NOARCH_PKGLIST"
    printf A
} >"$APT_FETCHED_PARTIAL_NOARCH_PKGLIST"
# assert the size is the same:
[ "$(stat -c '%s' "$REPO_NOARCH_PKGLIST")" \
      -eq \
      "$(stat -c '%s' "$APT_FETCHED_PARTIAL_NOARCH_PKGLIST")" \
    ]
# Final touch with the right time, so that no one notices.
touch -r "$REPO_NOARCH_PKGLIST" -- "$APT_FETCHED_PARTIAL_NOARCH_PKGLIST"

# Cksum verification shouldn't pass.

testsuccess aptget update
testsuccess aptcache show simple-package
testsuccess aptcache show simple-package-noarch
testfailure aptcache show nosuchpkg

# The last byte actually gets healed, because apt requests a range starting
# one byte earlier:

   # // Check for a partial file
   # struct stat SBuf;
   # if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
   # {
   #    // In this case we send an if-range query with a range header
   #    sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n",(long)SBuf.st_size - 1,
   # 	      TimeRFC1123(SBuf.st_mtime).c_str());
   #    Req += Buf;
   # }

# Here is how it looks when it is run.
# Look for noarch pkglist 548B;
# requested range 547-;
# length 1 in response.

# Run Testcase (120/158) test-corrupt-pkglist-index-in-partial-samesize-and-apt-update-rejects_via_http_dbgconn
# I: Preparing environment for test-corrupt-pkglist-index-in-partial-samesize-and-apt-update-rejects in /tmp/sh.UjcnJqYC/tmp.ZHgLWEkezB… I: Re-using gpg-pubkey/0
# I: Re-using gpg-pubkey/1
# DONE
# I: Re-using built-pkg/simple-package
# I: Re-using built-pkg/simple-package-noarch
# I: Re-using built-pkg/conflicting-package-one
# I: Re-using built-pkg/conflicting-package-two
# I: Re-using sign-repo-release/main-gpg
# gpg: WARNING: unsafe ownership on homedir `/tmp/sh.UjcnJqYC/tmp.Cn3jCRWuAt/sign-repo-release/main-gpg/gnupghome'
# gpg: WARNING: unsafe ownership on homedir `/tmp/sh.UjcnJqYC/tmp.Cn3jCRWuAt/sign-repo-release/main-gpg/gnupghome'
# Test of regex match of apt-get update … FAIL
# -.*Checksum mismatch.*
# \ No newline at end of file
# +GET /x86_64/base/release HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +HTTP/1.1 200 OK
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 1499
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-5db"
# +Accept-Ranges: bytes
# +
# +GET /noarch/base/release HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +Get:1 http://localhost:8080 x86_64 release [1499B]
# +HTTP/1.1 200 OK
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 1501
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-5dd"
# +Accept-Ranges: bytes
# +
# +Get:2 http://localhost:8080 noarch release [1501B]
# +GET /x86_64/base/pkglist.apt-tests.xz HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +HTTP/1.1 200 OK
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 884
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-374"
# +Accept-Ranges: bytes
# +
# +Fetched 3000B in 0s (0B/s)
# +Get:1 http://localhost:8080 x86_64/apt-tests pkglist [884B]
# +GET /x86_64/base/release.apt-tests HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +GET /noarch/base/pkglist.apt-tests.xz HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +Range: bytes=547-
# +If-Range: Thu, 19 Nov 2026 12:39:47 GMT
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +GET /noarch/base/release.apt-tests HTTP/1.1
# +Host: localhost:8080
# +Cache-Control: max-age=86400
# +User-Agent: RPM APT-HTTP/1.3
# +
# +
# +HTTP/1.1 200 OK
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 151
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-97"
# +Accept-Ranges: bytes
# +
# +HTTP/1.1 206 Partial Content
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 1
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-224"
# +Content-Range: bytes 547-547/548
# +
# +HTTP/1.1 200 OK
# +Server: nginx/1.30.7
# +Date: Thu, 19 Nov 2026 12:39:47 GMT
# +Content-Type: application/octet-stream
# +Content-Length: 151
# +Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# +Connection: keep-alive
# +ETag: "6afeee13-97"
# +Accept-Ranges: bytes
# +
# +Get:2 http://localhost:8080 x86_64/apt-tests release [151B]
# +Get:3 http://localhost:8080 noarch/apt-tests pkglist [548B]
# +Get:4 http://localhost:8080 noarch/apt-tests release [151B]
# +Fetched 1187B in 0s (64.5kB/s)
# +Reading Package Lists...
# +Building Dependency Tree...
# Test for failure in execution of the last cmd  … FAIL
# GET /x86_64/base/release HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1499
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-5db"
# Accept-Ranges: bytes
#
# GET /noarch/base/release HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# Get:1 http://localhost:8080 x86_64 release [1499B]
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1501
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-5dd"
# Accept-Ranges: bytes
#
# Get:2 http://localhost:8080 noarch release [1501B]
# GET /x86_64/base/pkglist.apt-tests.xz HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 884
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-374"
# Accept-Ranges: bytes
#
# Fetched 3000B in 0s (0B/s)
# Get:1 http://localhost:8080 x86_64/apt-tests pkglist [884B]
# GET /x86_64/base/release.apt-tests HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# GET /noarch/base/pkglist.apt-tests.xz HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# Range: bytes=547-
# If-Range: Thu, 19 Nov 2026 12:39:47 GMT
# User-Agent: RPM APT-HTTP/1.3
#
#
# GET /noarch/base/release.apt-tests HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 151
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-97"
# Accept-Ranges: bytes
#
# HTTP/1.1 206 Partial Content
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-224"
# Content-Range: bytes 547-547/548
#
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 151
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-97"
# Accept-Ranges: bytes
#
# Get:2 http://localhost:8080 x86_64/apt-tests release [151B]
# Get:3 http://localhost:8080 noarch/apt-tests pkglist [548B]
# Get:4 http://localhost:8080 noarch/apt-tests release [151B]
# Fetched 1187B in 0s (64.5kB/s)
# Reading Package Lists...
# Building Dependency Tree...
# Test of regex match of apt-cache show simple-package … PASS
# Test for successful execution of the last cmd  … PASS
# Package: simple-package
# Section: Other
# Installed Size: 0
# Maintainer: test@example.net
# Version: 1-alt1@1795091902
# Pre-Depends: rpmlib(FileDigests) (<= 4.6.0-1), rpmlib(PayloadIsLzma)
# Provides: simple-package (= 1-alt1)
# Architecture: x86_64
# Size: 1296
# MD5Sum: 0d20363cd171588627759fe7b1a8eb91
# Filename: simple-package-1-alt1.x86_64.rpm
# Description: Test package
#  Dummy description
# Changelog:
#  * Mon Sep 30 2019 Nobody <nobody@altlinux.org> 1-alt1
#  - Test package created
#
#
# Test for failure in execution of apt-cache show simple-package-noarch … FAIL
# Package: simple-package-noarch
# Section: Other
# Installed Size: 0
# Maintainer: test@example.net
# Version: 1-alt1@1795091902
# Pre-Depends: rpmlib(FileDigests) (<= 4.6.0-1), rpmlib(PayloadIsLzma)
# Provides: simple-package-noarch (= 1-alt1)
# Architecture: noarch
# Size: 1316
# MD5Sum: 1ca83957afe4ca3fadebc343a92118fd
# Filename: simple-package-noarch-1-alt1.noarch.rpm
# Description: Test package
#  Dummy description
# Changelog:
#  * Mon Sep 30 2019 Nobody <nobody@altlinux.org> 1-alt1
#  - Test package created
#
#
# Test for failure in execution of apt-cache show nosuchpkg … PASS
# W: Unable to locate package nosuchpkg
# E: No packages found
# NGINXLOG:
# ==> ./1795091987.419734.localhost:8080(127.0.0.1) <==
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Write(119) ...
#
# Write() = 119
# GET /x86_64/base/release HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(65536) ...
#
# Read() = 1753
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1499
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-5db"
# Accept-Ranges: bytes
#
# Origin: ALT Linux Team
# Label: apt-tests
# Suite: apt-tests
# Codename: 1795091987
# Date: Thu, 19 Nov 2026 12:39:47 +0000
# Architectures: x86_64
# Components: apt-tests
# Description: ALT Linux apt-tests
# MD5Sum:
#  5cbc71d080d6aab741873a244430e4f8 3003 base/pkglist.apt-tests
#  176a5325b7250cedcd6d15a6278847ba 884 base/pkglist.apt-tests.xz
#  43afaa4e0d55dd1505b25355cd6266d6 151 base/release.apt-tests
# BLAKE2b:
#  a8ec2b76be3e77ad7aebc5848bf1b2c1d7773cb1ed1e62e6379f7f57a24c4fb21cdacfa672da6e9b9d93fc980f1006a40529ff5af3e69071d727df05e125e142 3003 base/pkglist.apt-tests
#  8d64f610a4a004dea4c4713dede8829cf69bed1cebf441cef1fab9c5b1c7fd39c9e34f3eca8456cd7c0712a02ce3f5d5c3872614d98e567fa55fe342837bd454 884 base/pkglist.apt-tests.xz
#  fc02ee589d16d7e3eacaa2ea38dd5c86dcfaf3d5e899c2f460e7ed6c2effef503b3b9c55f77ba4fd500c42b0b4d76ba7cce99b631dfc45463eec3e5f61db75a6 151 base/release.apt-tests
#
# -----BEGIN PGP SIGNATURE-----
#
# iQGbBAABCAAGBQJq/u4TAAoJEMh6aDGFo/Yzh84L+Kfk1GALUTxy44k0AODFGC9D
# KMOavFu1dePd2uEO02U2v/XD73LZ8srj8qSoLe6CaJ+tbvIKYYTGOBZrf2w3jL2t
# PgJNpi1mR6riaIWot5JDYW/xLQDZuGXskq/4I7mD8zI5SGDWZOeAhF/hYCaZ/QQM
# JLjhtCIjTgQ5OPTHj19HNnuOgGlkBuJBEWmBEe7aHhWcFuZjAgudD5xMmklIPdiS
# smEx6usJInaSkqtObsOIvWkLZJBXw8hK28kL4B/TGKFG6OK8Ywx+5SBJklwV490+
# b1Gp4uLEIkrI+/8jlD4CmWepQ2gLrAPthdLUyUHxxWAsgZbmlzhWE3BdPa+pIL8v
# YmVy+UOwsNB4Lqhv2zfQW/4m3uWoo5nK8qlyoHskyQCcmMAgwDZ8swCdalDchwXW
# oOGGcL+bQZ0wWEKsAHexs4tNP+bGLR8gwvXzl/yEceMGZ7iwkdrqbiILmB9sC5y3
# KFDAYv9ovPaNFYtv77V3rZaFQG1vt5a8U/J4JPVl
# =+gyx
# -----END PGP SIGNATURE-----
#
# Read(63783) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Write(119) ...
#
# Write() = 119
# GET /noarch/base/release HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(63783) ...
#
# Read() = 1755
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1501
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-5dd"
# Accept-Ranges: bytes
#
# Origin: ALT Linux Team
# Label: apt-tests
# Suite: apt-tests
# Codename: 1795091987
# Date: Thu, 19 Nov 2026 12:39:47 +0000
# Architectures: noarch
# Components: apt-tests
# Description: ALT Linux apt-tests
# MD5Sum:
#  59942435d693e124282f8ef46d4c2175 953 base/pkglist.apt-tests
#  c8508ab30e4ac0d9eb1d64b8269a2ff6 548 base/pkglist.apt-tests.xz
#  d9f07dfd858590bebc8ff855d448fe0c 151 base/release.apt-tests
# BLAKE2b:
#  065bde10112d09cb30589fb4d12daf239db51b8b537359211dde514016eba729214729abcf18bef0dec2577f0000a54a520d914269bd8117d1a1c7d10e7f64ed 953 base/pkglist.apt-tests
#  77e7c87430dcec338bd84687bbff3b00960937d7bd0e44917e896acf3b1a28013f6cc780d5d867b7df460a336467111f0867684e9d1fdf76555f921f7129591e 548 base/pkglist.apt-tests.xz
#  06518a57a5cf0ee00f0e1691df55dbf945e11fb5806c9582d2d3298e823159b89f7e1b9fc715993bd23ea138b071a6d09505f9c4ae4056cb9975e5e837f870ab 151 base/release.apt-tests
#
# -----BEGIN PGP SIGNATURE-----
#
# iQGcBAABCAAGBQJq/u4TAAoJEMh6aDGFo/Yzt4IMAIRgR6BGXmpxgcVv9hF9/BYK
# Uj99ipSTzrdeRuyD3ackopGcrp2G7eohjKP4IjlENkVxHKPuQ+brPRryM0u194fk
# +sbmO9l+DSFOoMXiIZONaAeoUZro5KOba8ht25b8J/AwBm/2/K957NjoDGBF0ViH
# ExxlDQtV0MemAxrrlvV7OVjd7Ym1f6V6hamG3j5q/4CqQQFfFPTXONN5HVR0frsk
# N3tW4nbuBptlDKE7FDBsiQ/Qb69QAmpdLRSSXapww6/01IkrbXjSpt5VyzB6Z8Y5
# A2UWfF6YGDuivk5F+7QcHFbODdQT9q6jqTHsocEHoCFypjyrEN3eiKeZCnB2MKY+
# c2DBQnN4Bn3ANHr6KwrsZ5VfFs+PQWZDptB+BM9aph6Df7JWmKM2F0WsxPVXtbu1
# XydTr5pwK8ZWhcqsEmzM7c7y5ipfkOL5dF7uHOzjzr0Ng2pA4rb3LHZdtjHpUurd
# di3yRKv36globOLzuaLN463yCxQBJDqMM6ROVU3CBw==
# =D1wh
# -----END PGP SIGNATURE-----
#
# Read(62028) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# ==> ./1795091987.428345.localhost:8080(127.0.0.1) <==
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Write(132) ...
#
# Write() = 132
# GET /x86_64/base/pkglist.apt-tests.xz HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(65536) ...
#
# Read() = 1137
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 884
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-374"
# Accept-Ranges: bytes
#
# 7zXZ  ִF!       Jq8&)] G+Y 2.	?D
# M?')Gsλmqq}dsC;4D{dC9|YB5ms*5iGb&ɜn&ېE7boG22zYeA3yK؟(5Q6ޱN~i~|r5e͸#6oWmz5K< n*b\oz8|'Q:0$D1@%WJמ-^> yQA^gfP^dgWƧh'm]M%noʑ#U/ιCZ&P0!sNDҤimpЙh{"Ikv̰,y
#  $ofMR?j4ORz$4%-#S|^{ݚ    p]QEw   yPy2g    YZ
# Read(64399) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Write(450) ...
#
# Write() = 450
# GET /x86_64/base/release.apt-tests HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
# GET /noarch/base/pkglist.apt-tests.xz HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# Range: bytes=547-
# If-Range: Thu, 19 Nov 2026 12:39:47 GMT
# User-Agent: RPM APT-HTTP/1.3
#
# GET /noarch/base/release.apt-tests HTTP/1.1
# Host: localhost:8080
# Cache-Control: max-age=86400
# User-Agent: RPM APT-HTTP/1.3
#
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(64399) ...
#
# Read() = 403
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 151
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-97"
# Accept-Ranges: bytes
#
# Archive: ALT Linux apt-tests
# Component: apt-tests
# Version: 1795091987
# Origin: ALT Linux Team
# Label: apt-tests
# Architecture: x86_64
# NotAutomatic: false
#
# Read(63996) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(63996) ...
#
# Read() = 277
# HTTP/1.1 206 Partial Content
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 1
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-224"
# Content-Range: bytes 547-547/548
#
# Z
# Read(63719) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Read(63719) ...
#
# Read() = 403
# HTTP/1.1 200 OK
# Server: nginx/1.30.7
# Date: Thu, 19 Nov 2026 12:39:47 GMT
# Content-Type: application/octet-stream
# Content-Length: 151
# Last-Modified: Thu, 19 Nov 2026 12:39:47 GMT
# Connection: keep-alive
# ETag: "6afeee13-97"
# Accept-Ranges: bytes
#
# Archive: ALT Linux apt-tests
# Component: apt-tests
# Version: 1795091987
# Origin: ALT Linux Team
# Label: apt-tests
# Architecture: noarch
# NotAutomatic: false
#
# Read(63316) ...
#
# Read() = -1
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
#
# Fd() = 3
# test-corrupt-pkglist-index-in-partial-samesize-and-apt-update-rejects_via_http_dbgconn ... FAIL
