From faca44b6cb0ffe19c579216bec920ac2d498aab3 Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Tue, 22 Aug 2023 13:33:35 +0200 Subject: [PATCH] Fix install conflict --- .../my_index/crates/crate/crate1.tgz | Bin 0 -> 10240 bytes .../my_index/crates/crate/crate2.tgz | Bin 0 -> 296 bytes .../index/cr/crate1/crate1-1.0.0.toml | 10 ++++++++ .../index/cr/crate2/crate2-1.0.0.toml | 10 ++++++++ .../independent/my_index/index/index.toml | 1 + testsuite/tests/install/independent/test.py | 23 ++++++++++++++++++ testsuite/tests/install/independent/test.yaml | 4 +++ .../softlinks/my_index/crate-0.1.0.tgz | Bin 10240 -> 349 bytes .../my_index/index/cr/crate/crate-0.1.0.toml | 2 +- testsuite/tests/install/softlinks/test.py | 13 +++++++++- 10 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 testsuite/tests/install/independent/my_index/crates/crate/crate1.tgz create mode 100644 testsuite/tests/install/independent/my_index/crates/crate/crate2.tgz create mode 100644 testsuite/tests/install/independent/my_index/index/cr/crate1/crate1-1.0.0.toml create mode 100644 testsuite/tests/install/independent/my_index/index/cr/crate2/crate2-1.0.0.toml create mode 100644 testsuite/tests/install/independent/my_index/index/index.toml create mode 100644 testsuite/tests/install/independent/test.py create mode 100644 testsuite/tests/install/independent/test.yaml diff --git a/testsuite/tests/install/independent/my_index/crates/crate/crate1.tgz b/testsuite/tests/install/independent/my_index/crates/crate/crate1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a8623c93b8abbc9765a6635232e4a54b7c7ccc6e GIT binary patch literal 10240 zcmeH}%Wi`(5JkP_E8KKn#xK0@wu^oPK@=QSAOZRR+R&ybivUTiR_*ly8_ffAE@P(X z@}W#w)Iok&W0;?WH8h`tDGVmG%9ON}Y40Z}lNsYC>aISMANwKiIA@2vX)ir*$$lyJ z7u$+a|EJ0gu4>w@jIq@qaHjQK_pk3Dn23})>2FAS{bfd)af-2-^PK-&|Fqp7(j?ux z#$WSy*Oh)Q+UCtwX>!gA_kWJSRR4XQd*NffTqyCi=l@jy!b-yVA4`vU-nstMdTzbX zdb|FL1pfc`fxnPt(mWjh3ywFKSL?6HNag!OA$&84`o97B>dXz@GUBkyufxo`&&;ee{6>%T{0w4eaAOHd&00JNY c0w4eaAOHd&00JNY0w4eaAOHd&@KXdn0PT*9F#rGn literal 0 HcmV?d00001 diff --git a/testsuite/tests/install/independent/my_index/crates/crate/crate2.tgz b/testsuite/tests/install/independent/my_index/crates/crate/crate2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..14a2617ac380bcae2166d0e1bfda6598a90a1118 GIT binary patch literal 296 zcmV+@0oVQ?iwFP!000001MSw!PJ}QN24L1aMQ7a0>E*P0w=U)xIs~B;0}0^!TP~V0 zM#o7kX5#-XC9mY_%U0)@bV+z*S_%P0Rl|Drpd zio7_6HeUU6=&LxEUHcU3BLC~fL2_&T4~>t>Cz|7${=e2g#R2_)10V9AAAWxqT%W&| zg#Z60*8HdbpKOkwW0AlB literal 0 HcmV?d00001 diff --git a/testsuite/tests/install/independent/my_index/index/cr/crate1/crate1-1.0.0.toml b/testsuite/tests/install/independent/my_index/index/cr/crate1/crate1-1.0.0.toml new file mode 100644 index 000000000..61c8709b7 --- /dev/null +++ b/testsuite/tests/install/independent/my_index/index/cr/crate1/crate1-1.0.0.toml @@ -0,0 +1,10 @@ +description = "Sample crate" +name = "crate1" +version = "1.0.0" +licenses = [] +maintainers = ["any@bo.dy"] +maintainers-logins = ["someone"] + +[origin."case(os)"."..."] +url = "file:../../../crates/crate/crate1.tgz" +hashes = ["sha256:d35efed8325f646652f533fa4094d580cf28bccc9cc1d85751738b446bbed37a"] \ No newline at end of file diff --git a/testsuite/tests/install/independent/my_index/index/cr/crate2/crate2-1.0.0.toml b/testsuite/tests/install/independent/my_index/index/cr/crate2/crate2-1.0.0.toml new file mode 100644 index 000000000..776771516 --- /dev/null +++ b/testsuite/tests/install/independent/my_index/index/cr/crate2/crate2-1.0.0.toml @@ -0,0 +1,10 @@ +description = "Sample crate" +name = "crate2" +version = "1.0.0" +licenses = [] +maintainers = ["any@bo.dy"] +maintainers-logins = ["someone"] + +[origin."case(os)"."..."] +url = "file:../../../crates/crate/crate2.tgz" +hashes = ["sha256:8a814f2f0683b3b4db10a1c1e08e951d81de0deff2fa0f70a29295e45184b795"] \ No newline at end of file diff --git a/testsuite/tests/install/independent/my_index/index/index.toml b/testsuite/tests/install/independent/my_index/index/index.toml new file mode 100644 index 000000000..c2a2c7dbc --- /dev/null +++ b/testsuite/tests/install/independent/my_index/index/index.toml @@ -0,0 +1 @@ +version = "1.2" diff --git a/testsuite/tests/install/independent/test.py b/testsuite/tests/install/independent/test.py new file mode 100644 index 000000000..c55980097 --- /dev/null +++ b/testsuite/tests/install/independent/test.py @@ -0,0 +1,23 @@ +""" +Test installation of two independent crates with `alr install` to verify that +our deployment system doesn't introduce any conflicts. +""" + +from drivers.alr import run_alr, init_local_crate +from drivers.asserts import assert_eq, assert_match, assert_installed +from subprocess import run + +import os + + +PREFIX=os.path.join(os.getcwd(), "install") +PREFIX_ARG=f"--prefix={PREFIX}" + +# Install both crates one after the other, shouldn't fail +run_alr("install", PREFIX_ARG, "crate1") +run_alr("install", PREFIX_ARG, "crate2") + +# Check contents of the prefix +assert_installed(PREFIX, ["crate1=1.0.0", "crate2=1.0.0"]) + +print('SUCCESS') \ No newline at end of file diff --git a/testsuite/tests/install/independent/test.yaml b/testsuite/tests/install/independent/test.yaml new file mode 100644 index 000000000..0a859639c --- /dev/null +++ b/testsuite/tests/install/independent/test.yaml @@ -0,0 +1,4 @@ +driver: python-script +indexes: + my_index: + in_fixtures: false diff --git a/testsuite/tests/install/softlinks/my_index/crate-0.1.0.tgz b/testsuite/tests/install/softlinks/my_index/crate-0.1.0.tgz index 50b40e1f52976905a0b7ece37c17180b3be51fc1..11effa04cedfa0880e3d5fefb46130889b860442 100644 GIT binary patch literal 349 zcmV-j0iymNiwFP!000001MQcAYJ)HkhVv-Cz-%ri=6P)Aid&~eE$s1ku`Nhjox-KC z?f(!A7`VePmrHhS(U&herBrWJBsAl_3vcpHkKb1mS({}>8_IH}iHyxv;$kH<=G65? zn_+~FafDT{(7z`l>vhKdO~#+${|Vgt-&VD7jI)2gr2a`;o=1)! zm6-0deXZIE8I6Gd8~>M|E*N7){kt&M+ysnA{Xc_A|6FuZYhcy>Z$kgKHq<}-$7k06 zmrRTxIM40E{hxw==lJ}mWx~$`|I_{tO>-28v9SM->fiGU;QpVc8-C6S3FPq*_a1wr6M{pA`2{k5?k`hVjNz3N|X_Y-g2>F?vb@9RKt1?%&lNrWeM@~BK7 zn{vIaSJR&;`a$IXt^RlUe}x_)8aoXFr{+Hy=@Zff3?u)?a!>jGHUIBPH&rY6NPo+s zzcn8HKSjRL?+ogH9v!|75cJP;n^^x_{hbs2X`1baqx^aOABF=j2!H?xfB*=900@8p i2!H?xfB*=900@8p2!H?xfB*=900@8p2!OyZ5x4+d)Qy7x diff --git a/testsuite/tests/install/softlinks/my_index/index/cr/crate/crate-0.1.0.toml b/testsuite/tests/install/softlinks/my_index/index/cr/crate/crate-0.1.0.toml index 64f0a36f0..dd47659fa 100644 --- a/testsuite/tests/install/softlinks/my_index/index/cr/crate/crate-0.1.0.toml +++ b/testsuite/tests/install/softlinks/my_index/index/cr/crate/crate-0.1.0.toml @@ -8,4 +8,4 @@ executables=['main'] [origin.'case(os)'.'...'] url = "file:../../../crate-0.1.0.tgz" -hashes = ["sha256:35cc9636468031e1874fe142a6f40557d3befc6dd26cdded0401f440534f4bd6"] +hashes = ["sha256:73d1455dd4b49ea598faa939557c15046db6c689552db03fd6a49c57d3cbc1b2"] diff --git a/testsuite/tests/install/softlinks/test.py b/testsuite/tests/install/softlinks/test.py index 64b8b8dcb..43e3bafe5 100644 --- a/testsuite/tests/install/softlinks/test.py +++ b/testsuite/tests/install/softlinks/test.py @@ -1,5 +1,16 @@ """ -Test that binary files containing softlinks can be installed properly +Test that binary files containing softlinks can be installed properly. The test +crate contains all kinds of pernicious links (broken, recursive, etc.): + +crate +├── bin -> subdir/bin +├── broken -> missing +└── subdir + ├── bin + │ ├── loop -> ../../subdir + │ └── x + ├── parent -> .. + └── self -> ../subdir """ import sys