@@ -1118,10 +1118,10 @@ func runExternalTest(c cluster.TestCluster, mach platform.Machine, testNum int)
11181118 // This is a non-exclusive test
11191119 unit := fmt .Sprintf ("%s-%d.service" , KoletExtTestUnit , testNum )
11201120 // Reboot requests are disabled for non-exclusive tests
1121- cmd = fmt .Sprintf ("sudo . /kolet run-test-unit --deny-reboots %s" , shellquote .Join (unit ))
1121+ cmd = fmt .Sprintf ("sudo /usr/local/bin /kolet run-test-unit --deny-reboots %s" , shellquote .Join (unit ))
11221122 } else {
11231123 unit := fmt .Sprintf ("%s.service" , KoletExtTestUnit )
1124- cmd = fmt .Sprintf ("sudo . /kolet run-test-unit %s" , shellquote .Join (unit ))
1124+ cmd = fmt .Sprintf ("sudo /usr/local/bin /kolet run-test-unit %s" , shellquote .Join (unit ))
11251125 }
11261126 stdout , err = c .SSH (mach , cmd )
11271127
@@ -1893,9 +1893,14 @@ func runTest(h *harness.H, t *register.Test, pltfrm string, flight platform.Flig
18931893 t .Run (tcluster )
18941894}
18951895
1896- // ScpKolet searches for a kolet binary and copies it to the machine.
1896+ // ScpKolet searches for a kolet binary and copies it to the machines.
1897+ // Write initially to a .partial file in the same directory and then
1898+ // rename since systemd.path units may be watching and we don't want
1899+ // them to start while the file is still transferring.
18971900func ScpKolet (machines []platform.Machine ) error {
18981901 mArch := Options .CosaBuildArch
1902+ remotepath := "/usr/local/bin/kolet"
1903+ remotepathpartial := remotepath + ".partial"
18991904 exePath , err := os .Executable ()
19001905 if err != nil {
19011906 return errors .Wrapf (err , "finding path of executable" )
@@ -1908,8 +1913,21 @@ func ScpKolet(machines []platform.Machine) error {
19081913 } {
19091914 kolet := filepath .Join (d , "kolet" )
19101915 if _ , err := os .Stat (kolet ); err == nil {
1911- if err := cluster .DropLabeledFile (machines , kolet , "bin_t" ); err != nil {
1912- return errors .Wrapf (err , "dropping kolet binary" )
1916+ in , err := os .Open (kolet )
1917+ if err != nil {
1918+ return err
1919+ }
1920+ defer in .Close ()
1921+ for _ , m := range machines {
1922+ if _ , err := in .Seek (0 , 0 ); err != nil {
1923+ return errors .Wrapf (err , "seeking kolet binary" )
1924+ }
1925+ if err := platform .InstallFile (in , m , remotepathpartial ); err != nil {
1926+ return errors .Wrapf (err , "dropping kolet binary" )
1927+ }
1928+ if out , stderr , err := m .SSH (fmt .Sprintf ("sudo mv %s %s" , remotepathpartial , remotepath )); err != nil {
1929+ return errors .Wrapf (err , "running sudo mv %s %s: %s: %s" , remotepathpartial , remotepath , out , stderr )
1930+ }
19131931 }
19141932 return nil
19151933 }
0 commit comments