On Sat, 12 Aug 2017 16:13:11 +0300 Oleg Pykhalov wrote: > Hello Christopher, > > Christopher Baines writes: > > … > >> >> On Thu, 10 Aug 2017 08:18:20 +0100 > >> >> Christopher Baines wrote: > >> >> > >> >>> I've attached the beginnings of a system test for this. I > >> >>> haven't got as far as actually testing the service directly > >> >>> yet, but I'm going to try testing it, both when running as > >> >>> root, and when not running as root. > >> >>> > >> >>> A VM start script can be created from this rsync.scm file, by > >> >>> running: guix system vm gnu/tests/rsync.scm > >> >>> > >> >>> Also, the test itself can be run by doing: > >> >>> make check-system TESTS=rsync > >> >> > >> >> I've now got around to actually testing the service. I've > >> >> attached a patch which creates two system tests. One which > >> >> tests the service with the default port, and one with a higher > >> >> port (I randomly picked 2000). > >> >> > >> >> The default port test currently passes, but the higher port one > >> >> currently fails as the rsync service can't create the PID file. > >> >> > >> >> One option to fix this would be to create a /var/run/rsync > >> >> directory which is owned by the rsyncd user, and then create the > >> >> PID file as /var/run/rsync/pid. > >> > > >> > I'll check it later, if you'll not be faster than me. :-) > >> > > >> >> Just let me know if you have any questions? > >> > … > >> > > >> > I successfully passed you previous patch test, but the new patch > >> > one with two “ports” fails. > >> > >> Trying to understand what is going on. Working on your latest test > >> patch. > >> > >> This is what I currently have. It's not differ from your patch > >> except commented test below. guix/gnu/tests/rsync.scm > >> https://paste.pound-python.org/raw/ZyfPIvOWAbPd7blPRXf7/ > >> > >> I fully commented > >> (test-equal "Test file correctly received from share" …). > >> > >> (test-assert "Test file copied to share" > >> … > >> (zero? ; ERROR HERE > >> (system* "rsync" "/tmp/input" "localhost::files/"))) > >> > >> Bottom of test log: > >> --8<---------------cut here---------------start------------->8--- > >> rsync: mkstemp ".input.Y6OhRW" (in files) failed: Permission denied > >> (13) rsync error: some files/attrs were not transferred (see > >> previous errors) (code 23) at main.c(1178) [sender=3.1.2] QEMU > >> runs as PID 5 connected to QEMU's monitor > >> read QEMU monitor prompt > >> connected to guest REPL > >> %%%% Starting test rsync (Writing full log to "rsync.log") > >> marionette is ready > >> /gnu/store/bm3kvdwh8q3spvhxbmpmcjwz3fng8z5f-rsync-test-builder:1: > >> FAIL Test file copied to share # of expected passes 2 > >> # of unexpected failures 1 > >> note: keeping build directory `/tmp/guix-build-rsync-test.drv-9' > >> builder for > >> `/gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv' failed > >> with exit code 1 @ > >> build-failed /gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv > >> - 1 builder for > >> `/gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv' failed > >> with exit code 1 TOTAL: 1 > >> FAIL: /gnu/store/s0rwmr3iha48jbw2b9xkzcqqsamdl21q-rsync-test make: > >> *** [Makefile:5217: check-system] Error 1 --8<---------------cut > >> here---------------end--------------->8--- > > > > With the change to add the uid to the rsync configuration file, the > > rsync-with-default-port passes for me. What test are you running > > here? > > It was “rsync-with-default-port”. With “uid” passed successfully all > tests in “rsync-with-default-port”. > > Test 2000 port > ============== > > The “test-rsync-with-port-2000” fails, because we sync with default > rsync protocol port in this test but we need 2000. > > --8<---------------cut here---------------start------------->8--- > (test-assert "Test file copied to share" > … > (system* "rsync" "/tmp/input" "localhost::files/")) > --8<---------------cut here---------------end--------------->8--- > > Why I thought about this: > --8<---------------cut here---------------start------------->8--- > rsync: failed to connect to localhost (127.0.0.1): Connection refused > (111) rsync error: error in socket IO (code 10) at > clientserver.c(125) [sender=3.1.2] rsync: failed to connect to > localhost (127.0.0.1): Connection refused (111) rsync error: error in > socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2] > --8<---------------cut here---------------end--------------->8--- > > Next lines: > --8<---------------cut here---------------start------------->8--- > ice-9/eval.scm:387:11: In procedure eval: > ice-9/eval.scm:387:11: In procedure open-file: No such file or > directory: "/tmp/output" QEMU runs as PID 5 > connected to QEMU's monitor > read QEMU monitor prompt > connected to guest REPL > %%%% Starting test rsync (Writing full log to "rsync.log") > marionette is ready > /gnu/store/ahmg6h2fnap2znwhl6b4jrjgp830h4dv-rsync-test-builder:1: > FAIL Test file copied to > share /gnu/store/ahmg6h2fnap2znwhl6b4jrjgp830h4dv-rsync-test-builder:1: > FAIL Test file correctly received from share # of expected > passes 2 # of unexpected failures 2 note: keeping build > directory `/tmp/guix-build-rsync-test.drv-13' builder for > `/gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv' failed > with exit code 1 @ > build-failed /gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv > - 1 builder for > `/gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv' failed > with exit code 1 TOTAL: 1 > FAIL: /gnu/store/rmb3hywspr34fwp5xinphaml7c4xjpvk-rsync-test make: > *** [Makefile:5217: check-system] Error 1 --8<---------------cut > here---------------end--------------->8--- > > I only fixed PID error in current moment. > > gnu/tests/rsync.scm > https://paste.pound-python.org/raw/D4ccInuJG0g0899GCdy2/ > > gnu/services/rsync.scm > https://paste.pound-python.org/raw/URDLeIV3XFZ29SjcZYc6/ Yep, I think I just stopped writing the test after finding the issue with the PID file. I haven't looked in to how to fix this in the test, so if you could, that would be great. Otherwise, I'll probably have time to look at this again within a week or so. You'll probably need to refactor the test a bit, as at the moment, the information regarding the port isn't available where you run the commands. > >> Also, I have (is related?) error on top of test log. > >> --8<---------------cut here---------------start------------->8--- > >> natsu@magnolia ~/src/guix$ ./pre-inst-env make check-system > >> TESTS=rsync-with-default-port Compiling Scheme modules... > >> warning: failed to load '(gnu tests admin)': > >> ERROR: In procedure allocate-struct: Wrong type argument in > >> position 2: 8 --8<---------------cut > >> here---------------end--------------->8--- > > > > I think I may have seen this error too, no idea what it relates to > > though. > > Should we report this as a bug? Ideally yes, but I have no idea where the bug might be. I guess it might be Guile, as I didn't find anything named allocate-struct in Guix.