Re: /etc/hosts setting in RPM spec file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yeah. If I ran "rpmbuild --rebuild package.src.rpm" and discovered it
was running sudo commands to muck with /etc/hosts on my local
environment, I'd get pretty upset.

On Mon, Dec 26, 2022 at 12:34 PM Jeremy McMillan
<jeremy.mcmillan@xxxxxxxxx> wrote:
>
> That's a bad idea. Changing systemwide hostname resolution for a unit test has huge side effects for a disposable use case. Please don't do this.
>
> It would be better to do something like mock gethostbyname() in a unit test mock resolver .so and use runtime linker hints like LD_PRELOAD to make sure the unit test binary links to the mock instead of the system resolver.
>
>
> On Thu, Dec 22, 2022 at 10:52 AM Jun Aruga (he / him) <jaruga@xxxxxxxxxx> wrote:
>>
>> Is there a way to set a /etc/hosts setting below or an equivalent one
>> in a RPM spec file? The rubygem-mysq2 RPM package's unit test needs
>> the setting to run SSL tests in the %check process of the
>> rubygem-mysql2.spec file.
>>
>> ```
>> $ cat /etc/hosts
>> ...
>> 127.0.0.1 mysql2gem.example.com
>> ```
>>
>> As a reference, here are the upstream mysql2 project's settings.
>> https://github.com/brianmario/mysql2/blob/7f6f33a6e0bd652d5e7087edb6e5d00df248d35b/.github/workflows/build.yml#L66
>> https://github.com/brianmario/mysql2/blob/7f6f33a6e0bd652d5e7087edb6e5d00df248d35b/.github/workflows/container.yml#L30
>>
>> Related PR on Fedora:
>> https://src.fedoraproject.org/rpms/rubygem-mysql2/pull-request/14
>>
>> Thanks for your help!
>>
>> --
>> Jun | He - Him | Timezone: UTC+1 or 2, Czech Republic
>> See <https://www.worldtimebuddy.com/czech-republic-prague-to-utc> for
>> the timezone.
>> _______________________________________________
>> packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
>> To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
>> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
>> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
>
> _______________________________________________
> packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux