Re: Sponsorship request: python-ping3
Hi, On 20 Oct 2023 at 09:03:07, Santiago Ruano Rincón wrote: > El 18/10/23 a las 00:56, Carles Pina i Estany escribió: > > I've checked that no ICMP replies even using the standard ping binary > > from iputils-ping: > > - > > Test-Command: set +e ; ping -c 4 8.8.8.8 ; ping -c 4 example.com ; curl -s > > -I https://en.wikipedia.org ; curl -s -L https://en.wikipedia.org | head -5 > > Depends: python3-ping3, iputils-ping, curl > > Restrictions: needs-root, needs-internet > > Features: test-name=test-real-ping > > - > > That's in: > > https://salsa.debian.org/carlespina/python-ping3/-/blob/autopkgtest-connectivity/debian/tests/control > > > > The output: > > https://salsa.debian.org/carlespina/python-ping3/-/jobs/4822521#L213 > > > > 4 packets transmitted, 0 received, 100% packet loss, time 3059ms > > 4 packets transmitted, 0 received, 100% packet loss, time 3079ms > > ... > > AFAIU, there are network restrictions on salsa. Reaching HTTPS in the > outside world should work. But I am not sure about ICMP. > > FWIW, this is probably overengineering, but it is also possible to use > namespaces to avoid reaching INET, pinging from one namespace to the > other. > > As example: > https://salsa.debian.org/debian/isc-dhcp/-/blob/master/debian/tests/client-server I liked the idea of using namespaces! Thanks very much, I might use it in the future. Like you, I think that for python-ping3 unit tests this is overengineering (but I might play with this for python-ping3 or somehting else in the future...). In python-ping3, upstream has some IPs and hostnames hardcoded. The hostnames are easy to "tweak" via /etc/hosts (even to ping 127.0.0.1). The IPs: last night, I thought that another approach would be to use iptables (or nftables) and destination NAT. Redirect 8.8.8.8 to 127.0.0.1. It has the advantage that I could remove needs-internet, keeping all the unit tests 100% local. Cheers, -- Carles Pina i Estany https://carles.pina.cat signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
El 18/10/23 a las 00:56, Carles Pina i Estany escribió: > > Hi, > > On 17 Oct 2023 at 22:42:27, Carles Pina i Estany wrote: > > [...] > > > > 2. Regarding testing, this package is a bit a mess. First you probably > > > realized that you can't run tests at buildtime because a raw socket > > > requires root privilege. I see you designed custom autopkgtest to > > > > yep... > > > > [...] > > > > > From there you have two options: the first one is to drop the > > > Testsuite: field and keep the two tests you designed and call it a > > > day, or you drop it and write a third test stanza in > > > debian/tests/control with a shell script you'd also have to write > > > that moves the tests to the tmp dir autopkgtest creates, puts > > > localhost in /etc/hosts and then run tests. In that case you need > > > to add pytest to the dependencies of this test stanza. > > > > Sounds doable no problem, I'll try it this evening and see how it goes. > > From doable to "I'm 99% sure that not possible". I cannot send pings > from autopkgtest in salsa with any software. > > Side note: I remembered that when using "needs-internet": HTTP GET > requests (even using hostnames) works. This is my first package for > Debian, but I've used autopkgtest with needs-internet to run a sphinx > "linkcheck" and it was working correctly. > > I've checked that no ICMP replies even using the standard ping binary > from iputils-ping: > - > Test-Command: set +e ; ping -c 4 8.8.8.8 ; ping -c 4 example.com ; curl -s -I > https://en.wikipedia.org ; curl -s -L https://en.wikipedia.org | head -5 > Depends: python3-ping3, iputils-ping, curl > Restrictions: needs-root, needs-internet > Features: test-name=test-real-ping > - > That's in: > https://salsa.debian.org/carlespina/python-ping3/-/blob/autopkgtest-connectivity/debian/tests/control > > The output: > https://salsa.debian.org/carlespina/python-ping3/-/jobs/4822521#L213 > > 4 packets transmitted, 0 received, 100% packet loss, time 3059ms > 4 packets transmitted, 0 received, 100% packet loss, time 3079ms ... AFAIU, there are network restrictions on salsa. Reaching HTTPS in the outside world should work. But I am not sure about ICMP. FWIW, this is probably overengineering, but it is also possible to use namespaces to avoid reaching INET, pinging from one namespace to the other. As example: https://salsa.debian.org/debian/isc-dhcp/-/blob/master/debian/tests/client-server Cheers! -- Santiago signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Hi, On 20 Oct 2023 at 01:06:01, Pierre-Elliott Bécue wrote: > Carles Pina i Estany wrote on 18/10/2023 at 01:56:46+0200: > >> Tell me when you're fine with your work and I'll upload. > > > > To me, it can be uploaded :-) > > > > Let me know if I need or can do anything else. > > Uploaded, remember to put a tag on the latest commit. :) Excellent! Tagged via: $ git tag -s debian/4.0.4-1 ("Initial release" the commit message) $ git push upstream debian/4.0.4-1 I've just realised that there is "gbp tag" :-/ I'll use it next time. Reading the description in man gbp-tag: I was in the right branch and the verifications would have been ok! (last commit in the debian branch). Thanks! -- Carles Pina i Estany https://carles.pina.cat signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Carles Pina i Estany wrote on 18/10/2023 at 01:56:46+0200: > [[PGP Signed Part:No public key for A802884F60A55F81 created at > 2023-10-18T01:56:46+0200 using RSA]] > > Hi, > > On 17 Oct 2023 at 22:42:27, Carles Pina i Estany wrote: > > [...] > >> > 2. Regarding testing, this package is a bit a mess. First you probably >> > realized that you can't run tests at buildtime because a raw socket >> > requires root privilege. I see you designed custom autopkgtest to >> >> yep... >> >> [...] >> >> > From there you have two options: the first one is to drop the >> > Testsuite: field and keep the two tests you designed and call it a >> > day, or you drop it and write a third test stanza in >> > debian/tests/control with a shell script you'd also have to write >> > that moves the tests to the tmp dir autopkgtest creates, puts >> > localhost in /etc/hosts and then run tests. In that case you need >> > to add pytest to the dependencies of this test stanza. >> >> Sounds doable no problem, I'll try it this evening and see how it goes. > > From doable to "I'm 99% sure that not possible". I cannot send pings > from autopkgtest in salsa with any software. > > Side note: I remembered that when using "needs-internet": HTTP GET > requests (even using hostnames) works. This is my first package for > Debian, but I've used autopkgtest with needs-internet to run a sphinx > "linkcheck" and it was working correctly. > > I've checked that no ICMP replies even using the standard ping binary > from iputils-ping: > - > Test-Command: set +e ; ping -c 4 8.8.8.8 ; ping -c 4 example.com ; curl -s -I > https://en.wikipedia.org ; curl -s -L https://en.wikipedia.org | head -5 > Depends: python3-ping3, iputils-ping, curl > Restrictions: needs-root, needs-internet > Features: test-name=test-real-ping > - > That's in: > https://salsa.debian.org/carlespina/python-ping3/-/blob/autopkgtest-connectivity/debian/tests/control > > The output: > https://salsa.debian.org/carlespina/python-ping3/-/jobs/4822521#L213 > > 4 packets transmitted, 0 received, 100% packet loss, time 3059ms > 4 packets transmitted, 0 received, 100% packet loss, time 3079ms > > Even more: I think that curl -I (--head) (HTTP HEAD) might not work? but > curl HTTP GET works. I'm not sure about the curl -I but I don't think it > is relevant for this discussion. Somewhere, I think, I had read > something that it implied that autopkgtest needs-internet was using a > proxy? I cannot find it anyway and ICMP seems that cannot be used. > > So, for now, I've: > -Used wrap-and-soft (excellent!). > -Removed "set -e" in one of my Test-Commands: it's the default in > autopkgtest (I discovered with the "pings..." and then documenation) > -Fixed a cosmetic line in d/tests/control (s/features/Features) > -Removed "Testsuite: autopkgtest-pkg-pybuild" from d/control because > ICMP is not available anyway > -Ran dch -r to update the date > -"dput --force mentors python-ping3_4.0.4-1_amd64.changes" > > I've also discovered that there are a few unit tests in upstream that do > not work. Some have an easy fix, I will do a MR of the fixes that I've > done for some of them (separately, in GitHub, not tonight). > >> Your call. >> >> Tell me when you're fine with your work and I'll upload. > > To me, it can be uploaded :-) > > Let me know if I need or can do anything else. Uploaded, remember to put a tag on the latest commit. :) -- PEB signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Hi, On 17 Oct 2023 at 22:42:27, Carles Pina i Estany wrote: [...] > > 2. Regarding testing, this package is a bit a mess. First you probably > > realized that you can't run tests at buildtime because a raw socket > > requires root privilege. I see you designed custom autopkgtest to > > yep... > > [...] > > > From there you have two options: the first one is to drop the > > Testsuite: field and keep the two tests you designed and call it a > > day, or you drop it and write a third test stanza in > > debian/tests/control with a shell script you'd also have to write > > that moves the tests to the tmp dir autopkgtest creates, puts > > localhost in /etc/hosts and then run tests. In that case you need > > to add pytest to the dependencies of this test stanza. > > Sounds doable no problem, I'll try it this evening and see how it goes. From doable to "I'm 99% sure that not possible". I cannot send pings from autopkgtest in salsa with any software. Side note: I remembered that when using "needs-internet": HTTP GET requests (even using hostnames) works. This is my first package for Debian, but I've used autopkgtest with needs-internet to run a sphinx "linkcheck" and it was working correctly. I've checked that no ICMP replies even using the standard ping binary from iputils-ping: - Test-Command: set +e ; ping -c 4 8.8.8.8 ; ping -c 4 example.com ; curl -s -I https://en.wikipedia.org ; curl -s -L https://en.wikipedia.org | head -5 Depends: python3-ping3, iputils-ping, curl Restrictions: needs-root, needs-internet Features: test-name=test-real-ping - That's in: https://salsa.debian.org/carlespina/python-ping3/-/blob/autopkgtest-connectivity/debian/tests/control The output: https://salsa.debian.org/carlespina/python-ping3/-/jobs/4822521#L213 4 packets transmitted, 0 received, 100% packet loss, time 3059ms 4 packets transmitted, 0 received, 100% packet loss, time 3079ms Even more: I think that curl -I (--head) (HTTP HEAD) might not work? but curl HTTP GET works. I'm not sure about the curl -I but I don't think it is relevant for this discussion. Somewhere, I think, I had read something that it implied that autopkgtest needs-internet was using a proxy? I cannot find it anyway and ICMP seems that cannot be used. So, for now, I've: -Used wrap-and-soft (excellent!). -Removed "set -e" in one of my Test-Commands: it's the default in autopkgtest (I discovered with the "pings..." and then documenation) -Fixed a cosmetic line in d/tests/control (s/features/Features) -Removed "Testsuite: autopkgtest-pkg-pybuild" from d/control because ICMP is not available anyway -Ran dch -r to update the date -"dput --force mentors python-ping3_4.0.4-1_amd64.changes" I've also discovered that there are a few unit tests in upstream that do not work. Some have an easy fix, I will do a MR of the fixes that I've done for some of them (separately, in GitHub, not tonight). > Your call. > > Tell me when you're fine with your work and I'll upload. To me, it can be uploaded :-) Let me know if I need or can do anything else. Thank you! -- Carles Pina i Estany https://carles.pina.cat signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Hi, On 18 Oct 2023 at 00:08:43, Pierre-Elliott Bécue wrote: > Carles Pina i Estany wrote on 17/10/2023 at 23:42:27+0200: > > > On 17 Oct 2023 at 22:13:05, Pierre-Elliott Bécue wrote: > >> Hi, > >> > >> Carles Pina i Estany wrote on 16/10/2023 at > >> 21:27:33+0200: > >> > >> LGTM. Just for DEP-14, you should have the main branch named > >> debian/unstable and not debian/master. > > > > Oops! I actually followed > > https://salsa.debian.org/python-team/tools/python-modules/blob/master/policy.rst#branch-names > > in the section "Branch names" and mentions "debian/master". Perhaps that > > should be updated? > > > > Anyway, thanks for changing it! > > I could be wrong, but ISTR that the branch name was debian/master for a > long time in the policy (dates back to 2016 at least?) > > I'm not sure that DEP-14 was providing a recommendation for sid branches > at that time. > > Anyway, I think that indeed we should offer in the policy a choice > between debian/unstable, debian/latest or debian/master although I'd not I actually really prefer debian/unstable to debian/master, so I'm happy how it is now in the ping3 package :-) -- Carles Pina i Estany https://carles.pina.cat signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Carles Pina i Estany wrote on 17/10/2023 at 23:42:27+0200: > [[PGP Signed Part:No public key for A802884F60A55F81 created at > 2023-10-17T23:42:27+0200 using RSA]] > > Hi, > > On 17 Oct 2023 at 22:13:05, Pierre-Elliott Bécue wrote: >> Hi, >> >> Carles Pina i Estany wrote on 16/10/2023 at 21:27:33+0200: >> >> > [[PGP Signed Part:No public key for A802884F60A55F81 created at >> > 2023-10-16T21:27:33+0200 using RSA]] >> > >> > Hi, >> > >> > I ITP simplemonitor (#1016113), so I started with one of its >> > dependencies (actually is a "soft" dependency, optional but better to >> > have) (two more to come). >> > >> > So, I RFS for ping3: >> > https://mentors.debian.net/package/python-ping3/ >> > https://mentors.debian.net/debian/pool/main/p/python-ping3/python-ping3_4.0.4-1.dsc >> > >> > Also in: >> > https://salsa.debian.org/python-team/packages/python-ping3 >> > >> > This is my first package for Debian. Reviewing only, or reviewing + >> > sponsorship, are very appreciated. I'd like to get this one as right as >> > possible to do the next Python3 packages as good as possible. >> > >> > If it suits anyone better: I'm cpina on freenode (#debian-python for >> > example). >> > >> > Thank you very much for any advise! >> >> LGTM. Just for DEP-14, you should have the main branch named >> debian/unstable and not debian/master. > > Oops! I actually followed > https://salsa.debian.org/python-team/tools/python-modules/blob/master/policy.rst#branch-names > in the section "Branch names" and mentions "debian/master". Perhaps that > should be updated? > > Anyway, thanks for changing it! I could be wrong, but ISTR that the branch name was debian/master for a long time in the policy (dates back to 2016 at least?) I'm not sure that DEP-14 was providing a recommendation for sid branches at that time. Anyway, I think that indeed we should offer in the policy a choice between debian/unstable, debian/latest or debian/master although I'd not recommend the latest, because it makes less sense logically, so I'd deprecate it. >> I pushed a debian/unstable branch and modified gbp.conf. >> >> 1. Regarding packaging, lintian is happy and the files look good to >> me. You can install devscripts and use wrap-and-sort to make some >> things a bit more readable (IMHO). (have a look at devscripts in >> general, it's resourceful) > > Thanks for showing wrap-and-sort! Note taken and I will look at other > interesting things in devscripts. > >> 2. Regarding testing, this package is a bit a mess. First you probably >> realized that you can't run tests at buildtime because a raw socket >> requires root privilege. I see you designed custom autopkgtest to > > yep... > > [...] > >> From there you have two options: the first one is to drop the >> Testsuite: field and keep the two tests you designed and call it a >> day, or you drop it and write a third test stanza in >> debian/tests/control with a shell script you'd also have to write >> that moves the tests to the tmp dir autopkgtest creates, puts >> localhost in /etc/hosts and then run tests. In that case you need >> to add pytest to the dependencies of this test stanza. > > Sounds doable no problem, I'll try it this evening and see how it goes. > >> Tell me when you're fine with your work and I'll upload. > > thanks very much for the information, will let you know something. You're very welcome! -- PEB signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Hi, On 17 Oct 2023 at 22:13:05, Pierre-Elliott Bécue wrote: > Hi, > > Carles Pina i Estany wrote on 16/10/2023 at 21:27:33+0200: > > > [[PGP Signed Part:No public key for A802884F60A55F81 created at > > 2023-10-16T21:27:33+0200 using RSA]] > > > > Hi, > > > > I ITP simplemonitor (#1016113), so I started with one of its > > dependencies (actually is a "soft" dependency, optional but better to > > have) (two more to come). > > > > So, I RFS for ping3: > > https://mentors.debian.net/package/python-ping3/ > > https://mentors.debian.net/debian/pool/main/p/python-ping3/python-ping3_4.0.4-1.dsc > > > > Also in: > > https://salsa.debian.org/python-team/packages/python-ping3 > > > > This is my first package for Debian. Reviewing only, or reviewing + > > sponsorship, are very appreciated. I'd like to get this one as right as > > possible to do the next Python3 packages as good as possible. > > > > If it suits anyone better: I'm cpina on freenode (#debian-python for > > example). > > > > Thank you very much for any advise! > > LGTM. Just for DEP-14, you should have the main branch named > debian/unstable and not debian/master. Oops! I actually followed https://salsa.debian.org/python-team/tools/python-modules/blob/master/policy.rst#branch-names in the section "Branch names" and mentions "debian/master". Perhaps that should be updated? Anyway, thanks for changing it! > I pushed a debian/unstable branch and modified gbp.conf. > > 1. Regarding packaging, lintian is happy and the files look good to > me. You can install devscripts and use wrap-and-sort to make some > things a bit more readable (IMHO). (have a look at devscripts in > general, it's resourceful) Thanks for showing wrap-and-sort! Note taken and I will look at other interesting things in devscripts. > 2. Regarding testing, this package is a bit a mess. First you probably > realized that you can't run tests at buildtime because a raw socket > requires root privilege. I see you designed custom autopkgtest to yep... [...] > From there you have two options: the first one is to drop the > Testsuite: field and keep the two tests you designed and call it a > day, or you drop it and write a third test stanza in > debian/tests/control with a shell script you'd also have to write > that moves the tests to the tmp dir autopkgtest creates, puts > localhost in /etc/hosts and then run tests. In that case you need > to add pytest to the dependencies of this test stanza. Sounds doable no problem, I'll try it this evening and see how it goes. > Tell me when you're fine with your work and I'll upload. thanks very much for the information, will let you know something. -- Carles Pina i Estany https://carles.pina.cat signature.asc Description: PGP signature
Re: Sponsorship request: python-ping3
Hi, Carles Pina i Estany wrote on 16/10/2023 at 21:27:33+0200: > [[PGP Signed Part:No public key for A802884F60A55F81 created at > 2023-10-16T21:27:33+0200 using RSA]] > > Hi, > > I ITP simplemonitor (#1016113), so I started with one of its > dependencies (actually is a "soft" dependency, optional but better to > have) (two more to come). > > So, I RFS for ping3: > https://mentors.debian.net/package/python-ping3/ > https://mentors.debian.net/debian/pool/main/p/python-ping3/python-ping3_4.0.4-1.dsc > > Also in: > https://salsa.debian.org/python-team/packages/python-ping3 > > This is my first package for Debian. Reviewing only, or reviewing + > sponsorship, are very appreciated. I'd like to get this one as right as > possible to do the next Python3 packages as good as possible. > > If it suits anyone better: I'm cpina on freenode (#debian-python for > example). > > Thank you very much for any advise! LGTM. Just for DEP-14, you should have the main branch named debian/unstable and not debian/master. I pushed a debian/unstable branch and modified gbp.conf. 1. Regarding packaging, lintian is happy and the files look good to me. You can install devscripts and use wrap-and-sort to make some things a bit more readable (IMHO). (have a look at devscripts in general, it's resourceful) 2. Regarding testing, this package is a bit a mess. First you probably realized that you can't run tests at buildtime because a raw socket requires root privilege. I see you designed custom autopkgtest to still have some proper testing. That being said, the Testsuite: field is not useful as by default pybuild uses unittest which doesn't work on this package. I was hoping to provide you with a way to run upstream tests anyway which is possible (add python3-pytest as a build dep, disable tests in d/rules, and then configure autopkgtest-pkg-pybuild to use root privilege) but upstream made tests that actually require dns resolution (you won't have any) for the value in /etc/hostname which won't work on a buildd. We'd require to force change the value in this file and it'd make it a bit tedious. From there you have two options: the first one is to drop the Testsuite: field and keep the two tests you designed and call it a day, or you drop it and write a third test stanza in debian/tests/control with a shell script you'd also have to write that moves the tests to the tmp dir autopkgtest creates, puts localhost in /etc/hosts and then run tests. In that case you need to add pytest to the dependencies of this test stanza. Your call. Tell me when you're fine with your work and I'll upload. Cheers! -- PEB signature.asc Description: PGP signature