From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Julien Olivain <ju.o@free.fr>
Cc: buildroot@buildroot.org,
Ricardo Martincoski <ricardo.martincoski@datacom.com.br>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH 1/9 v3] support/testing: set date in emulated machine
Date: Sat, 8 Mar 2025 12:07:50 +0100 [thread overview]
Message-ID: <Z8wlBkArxK3Qh4WB@landeda> (raw)
In-Reply-To: <8fb79f2dfe7c9cedca2e2e854e4b3c48@free.fr>
Julien, All,
On 2025-03-07 19:49 +0100, Julien Olivain spake thusly:
> On 01/03/2025 16:05, Yann E. MORIN wrote:
> > When time comes to check certificates, the date and time in the emulated
> > machine should be close enough to the actual values, so that certificate
> > validity can be checked.
> >
> > Set the date to the date of the system. This is going to be accurate to
> > the second, which is, by far, enough for our purpose.
[--SNIP--]
> > + output, exit_code = self.run(f"date @{int(time.time())}")
> > + if exit_code:
> > + raise SystemError("Cannot set date in virtual machine")
> > +
> Is this really needed?
Yes: the skopeo test added in this series would otherwise fail with
(lines wrapped for readability):
[BRTEST# skopeo --version
skopeo version 1.18.0
[BRTEST# echo $?
0
[BRTEST# skopeo inspect docker://busybox:latest
FATA[0000] Error parsing image name "docker://busybox:latest":
pinging container registry registry-1.docker.io:
Get "https://registry-1.docker.io/v2/": tls: failed to verify
certificate: x509: certificate has expired or is not yet valid:
current time 1970-01-01T00:00:11Z is before 2025-03-05T00:00:00Z
> Arm and Aarch64 qemu machines includes a pl031 RTC.
> x86/x86_64 includes a mc146818 RTC.
> RISC-V has a Goldfish RTC.
The skopeo test uses the bundeled kernel with the "default" virtual
machine, and in that machine, the date is not set on boot: there is no
RTC regferenced in the kernel log, at least.
> If we revert this patch, the podman runtime test still succeed.
The reason to introduce this patch was not for podman, but for skopeo.
[--SNIP--]
> I understand that it is not always guaranteed that the qemu machine
> has a rtc and the used kernel has a driver for it, which is why we
> would like to set the date like this.
Exactly.
> But this could be left to the
> test implementer to make sure this is properly handled. And in the
> podman test case, you did.
>
> What do you think?
I think that setting the time is a generic topic, and that tests should
not need to do that.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-03-08 11:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-01 15:05 [Buildroot] [PATCH 0/9 v3] package/podman: new package (branch yem/podman) Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 1/9 v3] support/testing: set date in emulated machine Yann E. MORIN
2025-03-07 18:49 ` Julien Olivain
2025-03-08 11:07 ` Yann E. MORIN [this message]
2025-03-08 21:51 ` Julien Olivain
2025-03-01 15:05 ` [Buildroot] [PATCH 2/9 v3] package/shadow: install to staging for subids Yann E. MORIN
2025-03-07 13:15 ` Raphael Pavlidis
2025-03-01 15:05 ` [Buildroot] [PATCH 3/9 v3] package/conmon: depends on systemd when enabled Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 4/9 v3] package/slirp4netns: needs TUN support in the kernel Yann E. MORIN
2025-03-07 13:20 ` Raphael Pavlidis
2025-03-01 15:05 ` [Buildroot] [PATCH 5/9 v3] package/skopeo: add target variant Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 6/9 v3] package/cgroupfs-mount: tweak the kernel config Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 7/9 v3] package/cgroupfs-v2-mount: new package Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 8/9 v3] package/netavark: " Yann E. MORIN
2025-03-01 15:05 ` [Buildroot] [PATCH 9/9 v3] package/podman: " Yann E. MORIN
2025-03-07 13:40 ` Raphael Pavlidis
2025-03-07 19:38 ` Christian Stewart via buildroot
2025-03-08 11:02 ` Yann E. MORIN
2025-03-08 11:00 ` Yann E. MORIN
2025-03-09 8:30 ` Yann E. MORIN
2025-03-09 22:14 ` Yann E. MORIN
2025-03-07 18:55 ` Julien Olivain
2025-03-08 11:34 ` Yann E. MORIN
2025-03-08 22:03 ` Julien Olivain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z8wlBkArxK3Qh4WB@landeda \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=ju.o@free.fr \
--cc=ricardo.martincoski@datacom.com.br \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox