diff mbox

[OSSTEST,RFC,02/14] TestSupport: factor out target_jobdir_subdir

Message ID 1470300360-4435-3-git-send-email-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Aug. 4, 2016, 8:45 a.m. UTC
Returns a path inside job-specific directory with leafname subdir.

It will be used to return the distribution location of xtf.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 Osstest/TestSupport.pm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Ian Jackson Aug. 4, 2016, 11:47 a.m. UTC | #1
Wei Liu writes ("[OSSTEST PATCH RFC 02/14] TestSupport: factor out target_jobdir_subdir"):
> Returns a path inside job-specific directory with leafname subdir.
> 
> It will be used to return the distribution location of xtf.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 39d1c08..4f12ea1 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -64,7 +64,7 @@  BEGIN {
                       target_run_apt
                       target_install_packages target_install_packages_norec
                       target_jobdir target_extract_jobdistpath_subdir
-                      target_extract_jobdistpath
+                      target_extract_jobdistpath target_jobdir_subdir
                       lv_create lv_dev_mapper
 
                       poll_loop tcpconnect await_tcp
@@ -2175,14 +2175,20 @@  sub target_jobdir ($) {
     return $jobdir;
 }
 
+# returns a path inside job-specific dir with leafname $subdir on $ho
+sub target_jobdir_subdir($$) {
+    my ($ho, $subdir) = @_;
+    my $jobdir = target_jobdir($ho);
+    return "$jobdir/$subdir";
+}
+
 sub target_extract_jobdistpath_subdir ($$$$) {
     my ($ho, $subdir, $distpart, $buildjob) = @_;
     # Extracts dist part $distpart from job $buildjob into an
     # job-specific directory with leafname $subdir on $ho, and returns
     # the directory's pathname.  Does not need root.
-
     my $jobdir = target_jobdir($ho);
-    my $distdir = "$jobdir/$subdir";
+    my $distdir = target_jobdir_subdir($ho, $subdir);
     target_cmd($ho,"rm -rf $distdir && mkdir $distdir",60);
 
     my $path = get_stashed("path_${distpart}dist", $buildjob);