| 805 | } |
| 806 | |
| 807 | func newRun() *run { |
| 808 | var err error |
| 809 | r := &run{ |
| 810 | okDiff: time.Second * 9, // really big diff here but the build machines seem to be slow. need a different way for this |
| 811 | } |
| 812 | |
| 813 | // Read in all the defaults for all the options |
| 814 | fsInfo, err := fs.Find("cache") |
| 815 | if err != nil { |
| 816 | panic(fmt.Sprintf("Couldn't find cache remote: %v", err)) |
| 817 | } |
| 818 | r.runDefaultCfgMap = configmap.Simple{} |
| 819 | for _, option := range fsInfo.Options { |
| 820 | r.runDefaultCfgMap.Set(option.Name, fmt.Sprint(option.Default)) |
| 821 | } |
| 822 | |
| 823 | if uploadDir == "" { |
| 824 | r.tmpUploadDir, err = os.MkdirTemp("", "rclonecache-tmp") |
| 825 | if err != nil { |
| 826 | panic(fmt.Sprintf("Failed to create temp dir: %v", err)) |
| 827 | } |
| 828 | } else { |
| 829 | r.tmpUploadDir = uploadDir |
| 830 | } |
| 831 | fs.Logf(nil, "Temp Upload Dir: %v", r.tmpUploadDir) |
| 832 | |
| 833 | return r |
| 834 | } |
| 835 | |
| 836 | func (r *run) encryptRemoteIfNeeded(t *testing.T, remote string) string { |
| 837 | if !runInstance.rootIsCrypt || len(decryptedToEncryptedRemotes) == 0 { |