[AI Generated] packages: add curl and ant tests for Azure Linux - #4698
chalamalasetty wants to merge 3 commits into
Conversation
Add 22 preview test cases in 2 suites under lisa/microsoft/testsuites/packages/. Both suites are tagged ai-generated and declared maturity="preview", so the cases are not selected by default. The material is AI-generated from a corpus of behaviour obligations. It was verified by running every case on real Azure Linux 4.0 guests: 22 of 22 obligation cells proven on x86_64 and 22 of 22 on aarch64, with none failed and none skipped.
There was a problem hiding this comment.
Pull request overview
This PR adds two new AI-generated package validation test suites under lisa/microsoft/testsuites/packages/ to act as release-gate checks for Azure Linux, covering functional behaviors of curl and ant via self-contained guest-side fixtures and assertions.
Changes:
- Add
CurlSuitewith multiple cases exercising key curl behaviors (auth, redirects, output handling, proxying, retries, JSON, multipart, uploads). - Add
AntSuitewith multiple cases exercising Ant behaviors (platform adaptation, build discovery, Java compilation/execution, file management, artifact creation, and test-like orchestration).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lisa/microsoft/testsuites/packages/curl_test.py | New curl release-gate suite with loopback fixtures and marker-based output parsing. |
| lisa/microsoft/testsuites/packages/ant_test.py | New ant release-gate suite covering build/task behaviors and Java-related flows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Authentication validation, fixture/process cleanup, and reported test-count discrepancies remain unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (9)
lisa/microsoft/testsuites/packages/ant_test.py:1519
- Minor These assertions manually scan the
Findresult withany(...)and reduce each collection check to an opaque boolean. Use assertpy collection assertions on filtered path lists instead, so failures expose the missing or unexpected path and follow the repository's collection-assertion convention.
assert_that(
any(path.endswith("/default-item.tmp") for path in after_first)
).described_as("cleanup removes the selected default resource").is_false()
lisa/microsoft/testsuites/packages/ant_test.py:1470
- Major The stale-fixture assertion runs before the
try/finally. If an interrupted prior run leaves this directory behind, the assertion fails and the cleanup block is never entered, so the stale tree persists and every retry fails the same way. Arrange cleanup in the guaranteed-finally path before checking or handling stale state.
initial_entries = node.tools[Find].find_files(
base,
ignore_not_exist=True,
force_run=True,
)
lisa/microsoft/testsuites/packages/ant_test.py:63
- Minor The new suite leaves the case-level
requirementunset on all of its@TestCaseMetadatablocks. Although the current metadata class inherits the suite requirement implicitly, package suites conventionally declare the requirement on each case (for example,fips.py:32-40), and implicit inheritance prevents safe per-case constraints. Addrequirement=simple_requirement(supported_os=[CBLMariner])to each case.
@TestCaseMetadata(
description=(
"Verifies the ant behaviour: JAR creation remains usable when the\n"
"user does not supply a manifest or selected files.\n"
"\n"
lisa/microsoft/testsuites/packages/curl_test.py:190
- Minor: The generated origin script is written to the fixed
/tmp/azl-http-origin.py, butafter_caseonly kills the process and never removes this file. Reused VMs retain the fixture after every case; remove it during cleanup or place it under a per-case workspace.
node.get_pure_path("/tmp/azl-http-origin.py"),
append=False,
sudo=False,
lisa/microsoft/testsuites/packages/curl_test.py:196
- The curl suite invokes the executable directly through
node.execute()even though the repository provideslisa.tools.Curland existing suites use it for curl commands (for example,sanitytest.py:92-99). Please use the tool for these requests, usingforce_run=Truewhere repeated probes must not reuse a cached result, so the suite follows the shared installation/execution behavior.
probe = node.execute("curl -sf http://127.0.0.1:18080/")
lisa/microsoft/testsuites/packages/curl_test.py:602
- The fixture is normalized with
node.get_pure_path()above, but this command ignores that value and hard-codes/tmp/lisa-curl-form-file-part.txt. Usefixturehere so the command targets the file actually created by the test and preserves the repository's path-handling abstraction.
"--form upload=@/tmp/lisa-curl-form-file-part.txt "
lisa/microsoft/testsuites/packages/curl_test.py:206
- Major
Process.kill()only sends SIGTERM and returns; it does not wait for the server to exit. Since every case starts a new server on fixed port 18080, the next case can race the previous process and fail to bind withEADDRINUSE. Wait for the process to terminate before clearing it, or allocate an ephemeral port.
def after_case(self, log: Logger, **kwargs: Any) -> None:
"""Take down everything this suite arranged, whatever the verdict was."""
for process in self.arranged:
process.kill()
lisa/microsoft/testsuites/packages/curl_test.py:654
- Major This case claims to verify an HTTP PUT, but the fixture handles POST and PUT identically and the later assertions check only the echoed body. A POST would therefore pass; make the endpoint reject the wrong method or assert the verbose request line includes
PUT.
"curl --silent --show-error --upload-file upload.txt "
"http://127.0.0.1:18080/echo"
),
cwd=work_dir,
)
lisa/microsoft/testsuites/packages/curl_test.py:213
- Minor The new suite leaves the case-level
requirementunset on all of its@TestCaseMetadatablocks. Although the current metadata class inherits the suite requirement implicitly, package suites conventionally declare the requirement on each case (for example,fips.py:32-40), and implicit inheritance prevents safe per-case constraints. Addrequirement=simple_requirement(supported_os=[CBLMariner])to each case.
@TestCaseMetadata(
description=(
"Verifies the curl behaviour: Supply credentials for server\n"
"authentication to retrieve a known protected response.\n"
"\n"
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Lite
| priority=3, | ||
| # Bounds a hang only: measured cases finish in under 20 seconds. | ||
| timeout=1800, | ||
| tags=["ai-generated"], |
There was a problem hiding this comment.
using testsuite tags is enough, no need to specify it again in test case level
|
|
||
| @TestCaseMetadata( | ||
| description=( | ||
| "Verifies the ant behaviour: JAR creation remains usable when the\n" |
There was a problem hiding this comment.
"Verifies that Ant creates usable JARs with a supplied manifest and "
"selected files, and without a manifest or matching files.\n"
"\n"
"Corpus obligation: pkg:ant/archive-workflows/jar-manifest\n"
"This test was generated automatically from a behavior corpus."
| "Ant creates the supplied-manifest and default-manifest JARs" | ||
| ).is_equal_to(0) | ||
|
|
||
| first_list = node.execute("jar tf supplied.jar", cwd=root) |
There was a problem hiding this comment.
first_list = node.execute(
"jar tf supplied.jar",
cwd=root,
expected_exit_code=0,
expected_exit_code_failure_message=(
"Failed to list supplied.jar"
),
)
| ).contains("SUPPLIED-MANIFEST-MARKER") | ||
|
|
||
| node.tools[Rm].remove_directory(str(root / "META-INF")) | ||
| second_list = node.execute("jar tf default.jar", cwd=root) |
There was a problem hiding this comment.
use expected_exit_code and expected_exit_code_failure_message for second_list = node.execute("jar tf default.jar", cwd=root)
| node.tools[Rm].remove_directory(str(root)) | ||
|
|
||
| @TestCaseMetadata( | ||
| description=( |
There was a problem hiding this comment.
"Verifies that Ant ZIP extraction can filter archive entries "
"with patterns and transform output names with a mapper.\n"
"\n"
"Corpus obligation: pkg:ant/archive-workflows/patterned-extraction\n"
"This test was generated automatically from a behavior corpus."
| node.execute( | ||
| "ant -f build.xml make-archive", | ||
| cwd=workspace, | ||
| expected_exit_code=0, |
There was a problem hiding this comment.
add expected_exit_code_failure_message
| ) -> None: | ||
| """Verify obligation pkg:ant/archive-workflows/patterned-extraction.""" | ||
| log.info("Verifying obligation pkg:ant/archive-workflows/patterned-extraction") | ||
| workspace = node.get_pure_path("/tmp/lisa-ant-patterned-extraction") |
There was a problem hiding this comment.
workspace = node.get_pure_path(
f"/tmp/lisa-ant-patterned-extraction-{node.name}"
)
|
Overall comments P1 — Cleanup / workspace isolation Please make the temporary workspace naming and cleanup consistent across all test cases. Some cases use node.name, while others use a fixed /tmp path. In addition, verify_archive_workflows_zip_selection does not clean up the workspace in a finally block. This could cause cross-test interference or leave stale artifacts when a test fails. P2 — Avoid implementation-specific assertions Some assertions appear to validate implementation details rather than the stated behavior. For example, checking that archived file permissions are not preserved may be more specific than the behavior being tested. Please verify that these requirements are part of the corpus obligation; otherwise, they could introduce unnecessary false failures. P3 — Keep test scope aligned with the description patterned-extraction describes ZIP, WAR, and JAR extraction, but the implementation only exercises ZIP. Please either narrow the description to match the current coverage or extend the test to cover the other archive formats. P4 — Reduce unnecessary test complexity verify_archive_workflows_zip_selection introduces a Java helper to parse ZIP metadata. This adds significant complexity as well as another compilation/runtime dependency. If the behavior can be validated through Ant or standard JAR/ZIP tooling directly, please consider simplifying the test. P5 — Timeout All test cases use a 30-minute timeout, while the comment indicates that the measured execution time is under 20 seconds. Please consider reducing the timeout to avoid unnecessarily long hangs when a test gets stuck. |
AI Generated: Generated with GitHub Copilot. Cases are
maturity="preview".Description
AI generated curl and ant package tests from corpus (IR), validated on both x86_64 and Arm64 VMs, verified all tests passed on Azure Linux 4.0.
Adds two new test suites under
lisa/microsoft/testsuites/packages/:curl_test.py-CurlSuite, 11 cases covering HTTP verbs, redirects, auth, proxy, resumed and multipart transfers.ant_test.py-AntSuite, 11 cases covering build discovery, Java compilation, target orchestration, test execution and artifact production.Both suites declare
supported_os=[CBLMariner]and skip on guests older than 4.0.0.Related Issue
None.
Type of Change
Checklist
Test Validation
Key Test Cases:
verify_authenticate_server_request|verify_follow_http_redirect|verify_compile_java|verify_run_project_tests
Impacted LISA Features:
None (new suites only)
Tested Azure Marketplace Images:
Test Results
All 22 cases passed on both architectures (0 failed, 0 skipped).