Page MenuHomeFreeBSD

PythonGroup
ActivePublic

Recent Activity

Sep 14 2023

xmj removed a member for Python: xmj.
Sep 14 2023, 7:09 AM

Mar 29 2023

matthew added a member for Python: matthew.
Mar 29 2023, 8:08 AM

Mar 16 2023

vishwin added a member for Python: vishwin.
Mar 16 2023, 5:39 PM

Feb 20 2023

melifaro added a comment to D38053: ping: Add ATF-Python tests.

Yes, please!
In the meantime, I'll keep updating this "BASE" revision.
Changes:

  • Add the ability doctor IHL fields
  • Add the ability to remove inner packet load

I'm sorry for the delay, was focusing on fixing staff for the upcoming 13.2 release.

Feb 20 2023, 10:36 AM · Python
melifaro added a reverting change for D38053: ping: Add ATF-Python tests: rG3d360ca49cf8: Revert "ping: Add ATF-Python tests".
Feb 20 2023, 10:35 AM · Python
melifaro closed D38053: ping: Add ATF-Python tests.
Feb 20 2023, 10:33 AM · Python

Feb 11 2023

jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Yes, please!
In the meantime, I'll keep updating this "BASE" revision.
Changes:

  • Add the ability doctor IHL fields
  • Add the ability to remove inner packet load
Feb 11 2023, 9:35 PM · Python

Feb 10 2023

melifaro added a comment to D38053: ping: Add ATF-Python tests.

This revision is up for a while. What do you folks think of committing some or all of these tests that don't fail or current ping?
Nothing stops us from committing the other tests (or fixing some of the current tests) along with the ping changes or separately.

Feb 10 2023, 3:37 PM · Python
jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.
  • Add a missing extra white space

The output was originally taken from a branch that has code that trims these extra spaces. Let's leave those cosmetic changes for last.

Feb 10 2023, 12:44 AM · Python

Feb 9 2023

jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.
  • Do not shadow opts var
  • Disable net.inet.ip.process_options for RR options as well (this was discovered by randomizing the tests, as this sysctl was set by the previous tests)
Feb 9 2023, 7:34 PM · Python

Feb 7 2023

jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Updates:

  • Use ToolsHelper.set_sysctl
  • Use type hints
  • Skip failing tests
  • Remove tests of features not yet implemented
Feb 7 2023, 4:41 PM · Python

Feb 6 2023

ngie added a comment to D38053: ping: Add ATF-Python tests.
In D38053#872961, @ngie wrote:
  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

I thought of passing it via wrapper initially, but ended up with a bit more natural way - getting it from pytest itself.
I committed an example here.

Ha, very nice! I tend to prefer the f-string format (i.e., print(f" {k}: {v}"), is there a preference in style?

f-strings are fine given the FreeBSD v cpython support matrix, as long as you use 3.8+ only extensions to f-strings.

Feb 6 2023, 4:06 PM · Python
jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

@ngie Thank you for your suggestions, I'll try to implement them!
I also plan to update this file, hopefully this week, I'll remove/skip the tests for D37930 (as it hasn't landed yet), and start submitting the proposed fixes for the utility itself. I don't think all of them will be able to make it to the upcoming release, so there isn't really a time constraint, but I would like to start receiving feedback on that as well. Admittedly, having nice tests usually facilitates it!

Feb 6 2023, 2:10 PM · Python
ngie added a comment to D38053: ping: Add ATF-Python tests.
  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

I thought of passing it via wrapper initially, but ended up with a bit more natural way - getting it from pytest itself.
I committed an example here.

Ha, very nice! I tend to prefer the f-string format (i.e., print(f" {k}: {v}"), is there a preference in style?

Feb 6 2023, 4:52 AM · Python

Jan 26 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.
  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

I thought of passing it via wrapper initially, but ended up with a bit more natural way - getting it from pytest itself.
I committed an example here.

Jan 26 2023, 12:14 PM · Python

Jan 25 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.
  1. In the meantime the kernel delayed object reclamation model issue is fixed, maybe adapt 80fc25025ffcb0d369fc0b6d4d272ad6fd3f53c3 ?

Committed in 20ea7f26e413 .

Jan 25 2023, 4:50 PM · Python
jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.
  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

I thought of passing it via wrapper initially, but ended up with a bit more natural way - getting it from pytest itself.
I committed an example here.

Ha, very nice! I tend to prefer the f-string format (i.e., print(f" {k}: {v}"), is there a preference in style?

Jan 25 2023, 4:49 PM · Python
melifaro added a comment to D38053: ping: Add ATF-Python tests.
  1. In the meantime the kernel delayed object reclamation model issue is fixed, maybe adapt 80fc25025ffcb0d369fc0b6d4d272ad6fd3f53c3 ?

Committed in 20ea7f26e413 .

Jan 25 2023, 4:36 PM · Python
melifaro added a comment to D38053: ping: Add ATF-Python tests.
  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

I thought of passing it via wrapper initially, but ended up with a bit more natural way - getting it from pytest itself.
I committed an example here.

Jan 25 2023, 2:00 PM · Python

Jan 24 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.
In D38053#867487, @ngie wrote:

This looks like a good start. I'm not a fan of the methodize stuff, though. I think it makes the tests harder to read and harder to search. Is there a way to parameterize the tests without using methodize, even if it becomes slightly more verbose?

If you’re referring to “pytest.marks.parametrize”, it supports an optional id= parameter which better describes tests for humans.

Jan 24 2023, 8:16 PM · Python
ngie added a comment to D38053: ping: Add ATF-Python tests.

This looks like a good start. I'm not a fan of the methodize stuff, though. I think it makes the tests harder to read and harder to search. Is there a way to parameterize the tests without using methodize, even if it becomes slightly more verbose?

Jan 24 2023, 8:11 PM · Python

Jan 23 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

Thank you! I'll wait for @asomers comments to update the revision.

I'll document here my small - not really important - wishlist:

  1. Optional randomization of the test order, maybe something similar to pytest-random-order.

Nice one, can probably work out-of-the box, but the scope will be a single file, due to the way of ATF<>pytest interaction is implemented.

  1. When debugging atf-python tests, the output could be a little bit less busy, maybe pytest_terminal_summary et al. instead of print() could be one answer.

I get the intent and I agree. Maybe you could come up with an example (or even a diff) on how do you see it?

Sure! Once all ping tests are added, I should be more acquainted with the testing framework and propose a revision.

  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

  1. In the meantime the kernel delayed object reclamation model issue is fixed, maybe adapt 80fc25025ffcb0d369fc0b6d4d272ad6fd3f53c3 ?

Yep, been on my list for quite some time, I'll do the change in a day or two.

Great!

Jan 23 2023, 10:35 AM · Python

Jan 22 2023

melifaro added a comment to D38053: ping: Add ATF-Python tests.

Thank you! I'll wait for @asomers comments to update the revision.

I'll document here my small - not really important - wishlist:

  1. Optional randomization of the test order, maybe something similar to pytest-random-order.

Nice one, can probably work out-of-the box, but the scope will be a single file, due to the way of ATF<>pytest interaction is implemented.

  1. When debugging atf-python tests, the output could be a little bit less busy, maybe pytest_terminal_summary et al. instead of print() could be one answer.

I get the intent and I agree. Maybe you could come up with an example (or even a diff) on how do you see it?

  1. An atf_get_srcdir-equivalent to eventually read files relative to the source directory, however I think the idea is to disassociate from ATF later on.

This one slipped through the cracks, thanks for reminding! Will add in a day or two.

  1. In the meantime the kernel delayed object reclamation model issue is fixed, maybe adapt 80fc25025ffcb0d369fc0b6d4d272ad6fd3f53c3 ?

Yep, been on my list for quite some time, I'll do the change in a day or two.

Jan 22 2023, 1:08 PM · Python

Jan 17 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

Thank you! I'll wait for @asomers comments to update the revision.

Jan 17 2023, 10:23 PM · Python
melifaro accepted D38053: ping: Add ATF-Python tests.

So generally, it looks good to me, and I'm fine with committing the change. @asomers: what do you think?

Jan 17 2023, 12:50 PM · Python

Jan 16 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

Here are the last iteration changes:

  • Use a dictionary for expectations — this keeps both ping and pinger tests inline. Comparing the expected with the actual subprocess.CompletedProcess was also not feasible. It also was suggested initially by @melifaro.

One thing I noticed is that atf-python tests are slower than atf-sh, this was somewhat expected, but when all tests run, the total time builds up. I believe the gains are really from the development perspective.

Q: what's the runtime? e.g. median time reported by kyua test?

Jan 16 2023, 9:09 PM · Python
melifaro added a comment to D38053: ping: Add ATF-Python tests.

Here are the last iteration changes:

  • Use a dictionary for expectations — this keeps both ping and pinger tests inline. Comparing the expected with the actual subprocess.CompletedProcess was also not feasible. It also was suggested initially by @melifaro.

One thing I noticed is that atf-python tests are slower than atf-sh, this was somewhat expected, but when all tests run, the total time builds up. I believe the gains are really from the development perspective.

Q: what's the runtime? e.g. median time reported by kyua test?
There are some tests in net/routing, doing similar SingleVnet-isolated testing, written both in python and in C.
C version takes ~120ms per test, python version takes ~330ms. My take is that the runtime under 0.5 second is fine. It may also be not easy to decrease those 330ms, as pytest does a lot of preparation work, but the runner calls it for a single test.
I suspect that importing scapy.all may contribute to the delay here. Note that kyua needs to first run list for the tests (to determine the isolation details) and then actual test and cleanup procedures.
Importing scapy.all in the top of the file will cause all 3 cases to wait till scapy init. I'd probably try to check if it's possible to use scapy subset and/or try to load it only when needed.

Jan 16 2023, 8:17 PM · Python
jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Here are the last iteration changes:

Jan 16 2023, 7:01 PM · Python
jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Updates:

  • Simple one-line ping parameter expectations are subprocess.CompletedProcesses. No need to have a custom class (ExpectedProcess) that does essentially the same thing.
  • Incorporate the code from D37876. The pinger utility (now a function) returns a subprocess.CompletedProcess as well. Parametrization and cleanup are next.
Jan 16 2023, 10:56 AM · Python

Jan 15 2023

jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

Thank you for addressing the comments!
I’d still prefer to have the ids embedded explicitly via pytest.param, but I don’t insist on doing it.

Generally there may be somewhat conflicting ideas on what’s the “best” approach here, but personally I don’t think it’s a big deal here. This is a test code, it already is reasonably simple and allow for easy extension or debugging - that’s “good enough” and that’s what matters most (to me).

Jan 15 2023, 1:47 AM · Python
jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Address more suggestions:

  • Embed the ids explicitly via pytest.param().
Jan 15 2023, 1:41 AM · Python

Jan 14 2023

melifaro added a comment to D38053: ping: Add ATF-Python tests.

Thank you for addressing the comments!
I’d still prefer to have the ids embedded explicitly via pytest.param, but I don’t insist on doing it.

Jan 14 2023, 10:56 PM · Python
jlduran_gmail.com updated the diff for D38053: ping: Add ATF-Python tests.

Address some of the suggestions:

Jan 14 2023, 7:49 PM · Python
jlduran_gmail.com added inline comments to D38053: ping: Add ATF-Python tests.
Jan 14 2023, 4:51 PM · Python
jlduran_gmail.com added a comment to D38053: ping: Add ATF-Python tests.

This looks like a good start. I'm not a fan of the methodize stuff, though. I think it makes the tests harder to read and harder to search. Is there a way to parameterize the tests without using methodize, even if it becomes slightly more verbose?

Jan 14 2023, 4:41 PM · Python
melifaro added a comment to D38053: ping: Add ATF-Python tests.

Conceptually LGTM, please see some comments on the structure

Jan 14 2023, 3:19 PM · Python
asomers added a comment to D38053: ping: Add ATF-Python tests.

This looks like a good start. I'm not a fan of the methodize stuff, though. I think it makes the tests harder to read and harder to search. Is there a way to parameterize the tests without using methodize, even if it becomes slightly more verbose?

Jan 14 2023, 3:10 PM · Python
jlduran_gmail.com requested review of D38053: ping: Add ATF-Python tests.
Jan 14 2023, 1:44 PM · Python

Dec 27 2022

pi closed D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.
Dec 27 2022, 3:26 PM · Python
pi closed D34389: [NEW] mail/py-rfc6555: Happy Eyeballs Algorithm described in RFC 6555.
Dec 27 2022, 3:02 PM · Python

Dec 16 2022

dereks_lifeofadishwasher.com updated the diff for D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.

Update to 8.0.0.18

Dec 16 2022, 9:55 PM · Python

Dec 3 2022

lwhsu added a member for Python: lwhsu.
Dec 3 2022, 7:16 PM

Oct 19 2022

dereks_lifeofadishwasher.com updated the diff for D34389: [NEW] mail/py-rfc6555: Happy Eyeballs Algorithm described in RFC 6555.
  • Update WWW: to Makefile
Oct 19 2022, 12:52 AM · Python
dereks_lifeofadishwasher.com updated the diff for D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.
  • Change versioning to handbook: Example 19. Using USE_GITHUB to Access a Commit Between Two Versions
  • Update WWW: to Makefile
Oct 19 2022, 12:51 AM · Python

Oct 18 2022

koobs added a comment to D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.

@dereks_lifeofadishwasher.com Can we the/an existing version format that upstream uses (vX.Y.Z), optionally suffixed appropriately with relevent git tag if its 'in between versions' ?

Oct 18 2022, 11:09 PM · Python

Aug 6 2022

dereks_lifeofadishwasher.com updated the diff for D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.

Move to a GH_TAGNAME from the released 8.0.0 to include some IMAP fixes
All tests pass.

Aug 6 2022, 11:29 PM · Python

Jun 6 2022

dereks_lifeofadishwasher.com updated the diff for D34388: [NEW] mail/py-offlineimap3: Two-way synchronization of local Maildir and IMAP folders.
  • Use USES=pytest
Jun 6 2022, 11:26 PM · Python
dereks_lifeofadishwasher.com updated the diff for D34389: [NEW] mail/py-rfc6555: Happy Eyeballs Algorithm described in RFC 6555.

portfmt sort order

Jun 6 2022, 11:24 PM · Python
dereks_lifeofadishwasher.com added a comment to D34389: [NEW] mail/py-rfc6555: Happy Eyeballs Algorithm described in RFC 6555.

Yes, that works well. Thanks for the recommendation.

Jun 6 2022, 10:40 PM · Python
dereks_lifeofadishwasher.com updated the diff for D34389: [NEW] mail/py-rfc6555: Happy Eyeballs Algorithm described in RFC 6555.
  • update for USES=pytest
Jun 6 2022, 10:39 PM · Python