[Swift-commit] r3314 - in SwiftApps/adem-osg: . lib test
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Mon May 3 14:56:38 CDT 2010
Author: aespinosa
Date: 2010-05-03 14:56:38 -0500 (Mon, 03 May 2010)
New Revision: 3314
Added:
SwiftApps/adem-osg/lib/
SwiftApps/adem-osg/lib/adem.rb
SwiftApps/adem-osg/test/
SwiftApps/adem-osg/test/setup_test.rb
SwiftApps/adem-osg/test/test_offline.rb
SwiftApps/adem-osg/test/test_online.rb
SwiftApps/adem-osg/test/test_run.rb
Removed:
SwiftApps/adem-osg/adem-test.rb
SwiftApps/adem-osg/adem.rb
Log:
Moved to standard package directories
Deleted: SwiftApps/adem-osg/adem-test.rb
===================================================================
--- SwiftApps/adem-osg/adem-test.rb 2010-05-03 19:56:34 UTC (rev 3313)
+++ SwiftApps/adem-osg/adem-test.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -1,151 +0,0 @@
-#!/usb/bin/env ruby
-
-require 'test/unit'
-require 'adem'
-require 'yaml'
-
-module Adem
- module TestSetup
- def setup
- @conf = {
- :pacman_cache => "http://www.ci.uchicago.edu/~aespinosa/Cybershake",
- :ress_server => "osg-ress-1.fnal.gov",
- :virtual_organization => "engage"
- }
- @site_list = File.open("sites").read
- @ress = File.open("dummy_ress").read
- end
- end
-end
-
-class OnlineTest < Test::Unit::TestCase
- include Adem::TestSetup
-
- def test_sites_live
- conf = @conf
- begin
- sites(nil, conf, "non_existent_file")
- rescue SiteError => e
- assert_equal YAML.load(@site_list), e.output
- end
- end
-
- def test_ress_query
- conf = @conf
- ress = ress_query(conf).split "\n\n"
- assumption = true
- class_ads = [
- "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
- "GlueCEInfoGatekeeperPort", "GlueSEAccessProtocolEndpoint",
- "GlueSEAccessProtocolType", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir"
- ]
- missing = []
- ress.each do |entry|
- class_ads.each do |ad|
- assumption = assumption && entry.include?(ad)
- missing << ad if not entry.include?(ad)
- end
- end
- # False: there exist an entry without the expected classad.
- # Must report to osg support then
- assert assumption, "Missing attributes: \n\t#{missing.uniq.join(", ")}"
- end
-
- def test_app_avail
- pacman_cache = @conf[:pacman_cache]
- response = <<-eos
-http://www.ci.uchicago.edu/~aespinosa/Cybershake
- [ ] jbsim3d
- eos
- assert_equal(response, app_avail(pacman_cache))
- end
-
- def test_pacman_find_firefly
- # Firefly
- site = {
- :compute_element => "ff-grid.unl.edu:2119/jobmanager-pbs",
- :app_directory => "/panfs/panasas/CMS/app",
- :storage_element => "gsiftp://ff-gridftp.unl.edu:2811"
- }
- assert_equal(
- "/opt/pacman/pacman-3.28",
- pacman_find(
- "ff-grid.unl.edu/jobmanager-fork",
- "/panfs/panasas/CMS/app/engage"
- )
- )
- end
-
- def test_pacman_install_firefly_jbsim3d
- # Cleanup target first
- `globus-job-run ff-grid.unl.edu -env PACMAN_LOCATION=/opt/pacman/pacman-3.28 -d /panfs/panasas/CMS/app/engage /opt/pacman/pacman-3.28/bin/pacman -remove jbsim3d`
- expected = <<-eos
- jbsim3d found in http://www.ci.uchicago.edu/~aespinosa/Cybershake...
- Installing jbsim3d...
- Downloading jbsim3d_r794~RHEL5_amd64.tar.gz...
- Untarring jbsim3d_r794~RHEL5_amd64.tar.gz...
- jbsim3d has been installed.
- eos
- assert_equal(
- expected,
- pacman_install(
- "http://www.ci.uchicago.edu/~aespinosa/Cybershake:jbsim3d",
- { :contact => "ff-grid.unl.edu/jobmanager-fork",
- :pacman => "/opt/pacman/pacman-3.28",
- :path => "/panfs/panasas/CMS/app/engage" }
- )
- )
- end
-end
-
-class OfflineTest < Test::Unit::TestCase
- include Adem::TestSetup
-
- def test_sites_exception
- conf = @conf
- conf[:ress_server] = nil
- site_list = YAML.load @site_list
- assert_raise SiteError do
- sites(nil, conf, "non_existent_file")
- end
- end
-
- def test_sites_from_file
- conf = @conf
- site_list = YAML.load @site_list
- assert_equal(site_list, sites(nil, conf, "sites"))
- end
-
- def test_site_fork
- assert_equal "ff-grid.unl.edu:2119/jobmanager-fork", site_fork("ff-grid.unl.edu:2119/jobmanager-pbs")
- end
-
- def test_ress_parse
- site_list = YAML.load @site_list
- assert_equal site_list, ress_parse(@ress.split("\n\n"))
- end
-
- def test_app
- conf = @conf
- assert_equal("app", app(nil, conf))
- end
-
- def test_config
- assert_equal(@conf, config(nil, "config"))
- end
-end
-
-class RunTest < Test::Unit::TestCase
- include Adem::TestSetup
-
- def test_config
- assert_equal(@conf, run_command(["config"], "config", nil))
- end
-
- def test_sites_from_file
- conf = @conf
- site_list = YAML.load @site_list
- conf[:sites] = site_list
- assert_equal(conf, run_command(["sites"], "config", "sites"))
- end
-end
Deleted: SwiftApps/adem-osg/adem.rb
===================================================================
--- SwiftApps/adem-osg/adem.rb 2010-05-03 19:56:34 UTC (rev 3313)
+++ SwiftApps/adem-osg/adem.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -1,183 +0,0 @@
-#!/usr/bin/env ruby
-
-# = ADEM: Application software DEployment and Management
-# Author:: Zhengxiong Hou (original sh prototype)
-# Author:: Allan Espinosa (rewrite to ruby)
-#
-
-require 'yaml'
-require 'ftools'
-
-CONFIGURATION_FILE = "#{ENV['HOME']}/.adem/config"
-SITES_FILE = "#{ENV['HOME']}/.adem/sites"
-APPS_FILE = "#{ENV['HOME']}/.adem/apps"
-
-class SiteError < Exception
- attr_reader :output
- def initialize(output)
- @output = output
- end
-end
-
-class ConfigError < RuntimeError
-end
-
-def load_config(yaml_config)
- conf = YAML.load yaml_config
- conf.each do |key, val|
- conf.delete(key)
- conf[key.to_sym] = val
- end
- conf
-end
-
-def sites(args, conf, sites_file)
- begin
- YAML.load File.open sites_file
- rescue Errno::ENOENT
- result = ress_parse ress_query(conf).split("\n\n")
- raise SiteError.new(result)
- end
-end
-
-def ress_query(conf)
- `condor_status -pool #{conf[:ress_server]} -const \
- 'stringListIMember(\"VO:#{conf[:virtual_organization]}\", \
- GlueCEAccessControlBaseRule)' -long`
-end
-
-def ress_parse(ress)
- class_ads = [
- "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
- "GlueCEInfoGatekeeperPort", "GlueSEAccessProtocolEndpoint",
- "GlueSEAccessProtocolType", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir"
- ]
- site = {}
- ress.each do |entry|
- tmp = {}
- entry.each do |attr|
- attr.chomp!
- class_ads.each do |class_ad|
- if attr.include? class_ad
- tmp[class_ad] = attr.gsub!(/.*\=\ (.*)$/, '\1').gsub /"/, ''
- end
- end
- end
-
- next if tmp["GlueSiteUniqueID"] == nil
- site_name = tmp["GlueSiteUniqueID"]
- site[site_name] = {} if site[site_name] == nil
-
- compute_element = "#{tmp['GlueCEInfoHostName']}:#{tmp['GlueCEInfoGatekeeperPort']}/jobmanager-#{tmp['GlueCEInfoJobManager']}"
- if site[site_name]["compute_element"] == nil
- site[site_name]["compute_element"] = compute_element
- elsif site[site_name]["compute_element"] != compute_element
- old = site[site_name]["compute_element"].to_a
- old << compute_element
- site[site_name]["compute_element"] = old.uniq
- end
- storage_element = "gsiftp://#{tmp['GlueCEInfoHostName']}:2811"
- if site[site_name]["storage_element"] == nil
- site[site_name]["storage_element"] = storage_element
- elsif site[site_name]["storage_element"] != storage_element
- old = site[site_name]["storage_element"].to_a
- old << storage_element
- site[site_name]["storage_element"] = old.flatten.uniq
- end
- site[site_name]["data_directory"] = tmp['GlueCEInfoDataDir']
- site[site_name]["app_directory"] = tmp['GlueCEInfoApplicationDir']
-
- # Disabled because some storage endpoints are broken
- #storage_element = tmp['GlueSEAccessProtocolEndpoint'] if tmp['GlueSEAccessProtocolType'] == 'gsiftp'
- #next if storage_element == nil
- #if storage_element.include? ','
- #storage_element = storage_element.split(',').grep /gsiftp/
- #end
- #if site[site_name]["storage_element"] == nil
- #site[site_name]["storage_element"] = storage_element
- #elsif site[site_name]["storage_element"] != storage_element
- #old = site[site_name]["storage_element"].to_a
- #old << storage_element
- #site[site_name]["storage_element"] = old.flatten.uniq
- #end
- end
- site
-end
-
-def app(args, conf)
- "app"
-end
-
-def app_avail(pacman_cache)
- `pacman -trust-all-caches -lc #{pacman_cache}`
-end
-
-def app_deploy(app, conf)
- conf[:sites].each do |site|
- path = "#{site[:app_directory]}/#{conf[:virtual_organization]}"
- contact = site_fork site[:compute_element]
- site[:pacman] = pacman_find(contact, path) if not site[:pacman]
- target = {
- :contact => contact,
- :pacman => site[:pacman],
- :path => path
- }
- package = "#{conf[:pacman_cache]}:#{app}"
- pacman_install package, target
- end
-end
-
-def site_fork(compute_element)
- compute_element.gsub /jobmanager-.*$/, "jobmanager-fork"
-end
-
-def pacman_find(contact, rootdir)
- File.open("find_pacman.sh", "w") do |dump|
- dump.puts "#!/bin/bash"
- dump.puts "which pacman"
- end
- File.chmod 0755, "find_pacman.sh"
- resp = `globus-job-run #{contact} -d #{rootdir} -stage find_pacman.sh`
- File.delete "find_pacman.sh"
- File.dirname(File.dirname(resp))
-end
-
-def pacman_install(package, target)
- File.open("pacman_install.sh", "w") do |dump|
- dump.puts "#!/bin/bash"
- dump.puts "source #{target[:pacman]}/setup.sh"
- dump.puts "pacman -trust-all-caches -install #{package}"
- end
- File.chmod 0755, "pacman_install.sh"
- `globus-job-run #{target[:contact]} /bin/mkdir -p #{target[:path]}`
- resp = `globus-job-run #{target[:contact]} -d #{target[:path]} -stage pacman_install.sh`
- File.delete "pacman_install.sh"
- resp
-end
-
-def config(args, config_file)
- load_config File.open(config_file)
-end
-
-def run_command(args, config_file, sites_file)
- command = args.shift
- output = nil
- conf = load_config File.open(config_file)
- return conf if command == "config"
- begin
- site_args = nil
- site_args = args if command == "sites"
- conf[:sites] = sites(site_args, conf, sites_file)
- rescue SiteError => exception
- conf[:sites] = exception.output
- File.open(sites_file, "w") do |sites_file|
- sites_file << output.to_yaml
- end
- end
- return conf if command == "sites"
- app(args, conf)
-end
-
-if $0 == __FILE__
- run_command ARGV, CONFIGURATION_FILE, SITES_FILE
-end
Copied: SwiftApps/adem-osg/lib/adem.rb (from rev 3313, SwiftApps/adem-osg/adem.rb)
===================================================================
--- SwiftApps/adem-osg/lib/adem.rb (rev 0)
+++ SwiftApps/adem-osg/lib/adem.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -0,0 +1,183 @@
+#!/usr/bin/env ruby
+
+# = ADEM: Application software DEployment and Management
+# Author:: Zhengxiong Hou (original sh prototype)
+# Author:: Allan Espinosa (rewrite to ruby)
+#
+
+require 'yaml'
+require 'ftools'
+
+CONFIGURATION_FILE = "#{ENV['HOME']}/.adem/config"
+SITES_FILE = "#{ENV['HOME']}/.adem/sites"
+APPS_FILE = "#{ENV['HOME']}/.adem/apps"
+
+class SiteError < Exception
+ attr_reader :output
+ def initialize(output)
+ @output = output
+ end
+end
+
+class ConfigError < RuntimeError
+end
+
+def load_config(yaml_config)
+ conf = YAML.load yaml_config
+ conf.each do |key, val|
+ conf.delete(key)
+ conf[key.to_sym] = val
+ end
+ conf
+end
+
+def sites(args, conf, sites_file)
+ begin
+ YAML.load File.open sites_file
+ rescue Errno::ENOENT
+ result = ress_parse ress_query(conf).split("\n\n")
+ raise SiteError.new(result)
+ end
+end
+
+def ress_query(conf)
+ `condor_status -pool #{conf[:ress_server]} -const \
+ 'stringListIMember(\"VO:#{conf[:virtual_organization]}\", \
+ GlueCEAccessControlBaseRule)' -long`
+end
+
+def ress_parse(ress)
+ class_ads = [
+ "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
+ "GlueCEInfoGatekeeperPort", "GlueSEAccessProtocolEndpoint",
+ "GlueSEAccessProtocolType", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir"
+ ]
+ site = {}
+ ress.each do |entry|
+ tmp = {}
+ entry.each do |attr|
+ attr.chomp!
+ class_ads.each do |class_ad|
+ if attr.include? class_ad
+ tmp[class_ad] = attr.gsub!(/.*\=\ (.*)$/, '\1').gsub /"/, ''
+ end
+ end
+ end
+
+ next if tmp["GlueSiteUniqueID"] == nil
+ site_name = tmp["GlueSiteUniqueID"]
+ site[site_name] = {} if site[site_name] == nil
+
+ compute_element = "#{tmp['GlueCEInfoHostName']}:#{tmp['GlueCEInfoGatekeeperPort']}/jobmanager-#{tmp['GlueCEInfoJobManager']}"
+ if site[site_name]["compute_element"] == nil
+ site[site_name]["compute_element"] = compute_element
+ elsif site[site_name]["compute_element"] != compute_element
+ old = site[site_name]["compute_element"].to_a
+ old << compute_element
+ site[site_name]["compute_element"] = old.uniq
+ end
+ storage_element = "gsiftp://#{tmp['GlueCEInfoHostName']}:2811"
+ if site[site_name]["storage_element"] == nil
+ site[site_name]["storage_element"] = storage_element
+ elsif site[site_name]["storage_element"] != storage_element
+ old = site[site_name]["storage_element"].to_a
+ old << storage_element
+ site[site_name]["storage_element"] = old.flatten.uniq
+ end
+ site[site_name]["data_directory"] = tmp['GlueCEInfoDataDir']
+ site[site_name]["app_directory"] = tmp['GlueCEInfoApplicationDir']
+
+ # Disabled because some storage endpoints are broken
+ #storage_element = tmp['GlueSEAccessProtocolEndpoint'] if tmp['GlueSEAccessProtocolType'] == 'gsiftp'
+ #next if storage_element == nil
+ #if storage_element.include? ','
+ #storage_element = storage_element.split(',').grep /gsiftp/
+ #end
+ #if site[site_name]["storage_element"] == nil
+ #site[site_name]["storage_element"] = storage_element
+ #elsif site[site_name]["storage_element"] != storage_element
+ #old = site[site_name]["storage_element"].to_a
+ #old << storage_element
+ #site[site_name]["storage_element"] = old.flatten.uniq
+ #end
+ end
+ site
+end
+
+def app(args, conf)
+ "app"
+end
+
+def app_avail(pacman_cache)
+ `pacman -trust-all-caches -lc #{pacman_cache}`
+end
+
+def app_deploy(app, conf)
+ conf[:sites].each do |site|
+ path = "#{site[:app_directory]}/#{conf[:virtual_organization]}"
+ contact = site_fork site[:compute_element]
+ site[:pacman] = pacman_find(contact, path) if not site[:pacman]
+ target = {
+ :contact => contact,
+ :pacman => site[:pacman],
+ :path => path
+ }
+ package = "#{conf[:pacman_cache]}:#{app}"
+ pacman_install package, target
+ end
+end
+
+def site_fork(compute_element)
+ compute_element.gsub /jobmanager-.*$/, "jobmanager-fork"
+end
+
+def pacman_find(contact, rootdir)
+ File.open("find_pacman.sh", "w") do |dump|
+ dump.puts "#!/bin/bash"
+ dump.puts "which pacman"
+ end
+ File.chmod 0755, "find_pacman.sh"
+ resp = `globus-job-run #{contact} -d #{rootdir} -stage find_pacman.sh`
+ File.delete "find_pacman.sh"
+ File.dirname(File.dirname(resp))
+end
+
+def pacman_install(package, target)
+ File.open("pacman_install.sh", "w") do |dump|
+ dump.puts "#!/bin/bash"
+ dump.puts "source #{target[:pacman]}/setup.sh"
+ dump.puts "pacman -trust-all-caches -install #{package}"
+ end
+ File.chmod 0755, "pacman_install.sh"
+ `globus-job-run #{target[:contact]} /bin/mkdir -p #{target[:path]}`
+ resp = `globus-job-run #{target[:contact]} -d #{target[:path]} -stage pacman_install.sh`
+ File.delete "pacman_install.sh"
+ resp
+end
+
+def config(args, config_file)
+ load_config File.open(config_file)
+end
+
+def run_command(args, config_file, sites_file)
+ command = args.shift
+ output = nil
+ conf = load_config File.open(config_file)
+ return conf if command == "config"
+ begin
+ site_args = nil
+ site_args = args if command == "sites"
+ conf[:sites] = sites(site_args, conf, sites_file)
+ rescue SiteError => exception
+ conf[:sites] = exception.output
+ File.open(sites_file, "w") do |sites_file|
+ sites_file << output.to_yaml
+ end
+ end
+ return conf if command == "sites"
+ app(args, conf) if command == "app"
+end
+
+if $0 == __FILE__
+ run_command ARGV, CONFIGURATION_FILE, SITES_FILE
+end
Added: SwiftApps/adem-osg/test/setup_test.rb
===================================================================
--- SwiftApps/adem-osg/test/setup_test.rb (rev 0)
+++ SwiftApps/adem-osg/test/setup_test.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -0,0 +1,19 @@
+#!/usb/bin/env ruby
+
+require 'test/unit'
+require 'adem'
+require 'yaml'
+
+module Adem
+ module TestSetup
+ def setup
+ @conf = {
+ :pacman_cache => "http://www.ci.uchicago.edu/~aespinosa/Cybershake",
+ :ress_server => "osg-ress-1.fnal.gov",
+ :virtual_organization => "engage"
+ }
+ @site_list = File.open("sites").read
+ @ress = File.open("dummy_ress").read
+ end
+ end
+end
Added: SwiftApps/adem-osg/test/test_offline.rb
===================================================================
--- SwiftApps/adem-osg/test/test_offline.rb (rev 0)
+++ SwiftApps/adem-osg/test/test_offline.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -0,0 +1,38 @@
+require 'setup_test'
+
+class OfflineTest < Test::Unit::TestCase
+ include Adem::TestSetup
+
+ def test_sites_exception
+ conf = @conf
+ conf[:ress_server] = nil
+ site_list = YAML.load @site_list
+ assert_raise SiteError do
+ sites(nil, conf, "non_existent_file")
+ end
+ end
+
+ def test_sites_from_file
+ conf = @conf
+ site_list = YAML.load @site_list
+ assert_equal(site_list, sites(nil, conf, "sites"))
+ end
+
+ def test_site_fork
+ assert_equal "ff-grid.unl.edu:2119/jobmanager-fork", site_fork("ff-grid.unl.edu:2119/jobmanager-pbs")
+ end
+
+ def test_ress_parse
+ site_list = YAML.load @site_list
+ assert_equal site_list, ress_parse(@ress.split("\n\n"))
+ end
+
+ def test_app
+ conf = @conf
+ assert_equal("app", app(nil, conf))
+ end
+
+ def test_config
+ assert_equal(@conf, config(nil, "config"))
+ end
+end
Added: SwiftApps/adem-osg/test/test_online.rb
===================================================================
--- SwiftApps/adem-osg/test/test_online.rb (rev 0)
+++ SwiftApps/adem-osg/test/test_online.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -0,0 +1,81 @@
+require 'setup_test'
+
+class OnlineTest < Test::Unit::TestCase
+ include Adem::TestSetup
+
+ def test_sites_live
+ conf = @conf
+ begin
+ sites(nil, conf, "non_existent_file")
+ rescue SiteError => e
+ assert_equal YAML.load(@site_list), e.output
+ end
+ end
+
+ def test_ress_query
+ conf = @conf
+ ress = ress_query(conf).split "\n\n"
+ assumption = true
+ class_ads = [
+ "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
+ "GlueCEInfoGatekeeperPort", "GlueSEAccessProtocolEndpoint",
+ "GlueSEAccessProtocolType", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir"
+ ]
+ missing = []
+ ress.each do |entry|
+ class_ads.each do |ad|
+ assumption = assumption && entry.include?(ad)
+ missing << ad if not entry.include?(ad)
+ end
+ end
+ # False: there exist an entry without the expected classad.
+ # Must report to osg support then
+ assert assumption, "Missing attributes: \n\t#{missing.uniq.join(", ")}"
+ end
+
+ def test_app_avail
+ pacman_cache = @conf[:pacman_cache]
+ response = <<-eos
+http://www.ci.uchicago.edu/~aespinosa/Cybershake
+ [ ] jbsim3d
+ eos
+ assert_equal(response, app_avail(pacman_cache))
+ end
+
+ def test_pacman_find_firefly
+ # Firefly
+ site = {
+ :compute_element => "ff-grid.unl.edu:2119/jobmanager-pbs",
+ :app_directory => "/panfs/panasas/CMS/app",
+ :storage_element => "gsiftp://ff-gridftp.unl.edu:2811"
+ }
+ assert_equal(
+ "/opt/pacman/pacman-3.28",
+ pacman_find(
+ "ff-grid.unl.edu/jobmanager-fork",
+ "/panfs/panasas/CMS/app/engage"
+ )
+ )
+ end
+
+ def test_pacman_install_firefly_jbsim3d
+ # Cleanup target first
+ `globus-job-run ff-grid.unl.edu -env PACMAN_LOCATION=/opt/pacman/pacman-3.28 -d /panfs/panasas/CMS/app/engage /opt/pacman/pacman-3.28/bin/pacman -remove jbsim3d`
+ expected = <<-eos
+ jbsim3d found in http://www.ci.uchicago.edu/~aespinosa/Cybershake...
+ Installing jbsim3d...
+ Downloading jbsim3d_r794~RHEL5_amd64.tar.gz...
+ Untarring jbsim3d_r794~RHEL5_amd64.tar.gz...
+ jbsim3d has been installed.
+ eos
+ assert_equal(
+ expected,
+ pacman_install(
+ "http://www.ci.uchicago.edu/~aespinosa/Cybershake:jbsim3d",
+ { :contact => "ff-grid.unl.edu/jobmanager-fork",
+ :pacman => "/opt/pacman/pacman-3.28",
+ :path => "/panfs/panasas/CMS/app/engage" }
+ )
+ )
+ end
+end
Added: SwiftApps/adem-osg/test/test_run.rb
===================================================================
--- SwiftApps/adem-osg/test/test_run.rb (rev 0)
+++ SwiftApps/adem-osg/test/test_run.rb 2010-05-03 19:56:38 UTC (rev 3314)
@@ -0,0 +1,16 @@
+require 'setup_test'
+
+class RunTest < Test::Unit::TestCase
+ include Adem::TestSetup
+
+ def test_config
+ assert_equal(@conf, run_command(["config"], "config", nil))
+ end
+
+ def test_sites_from_file
+ conf = @conf
+ site_list = YAML.load @site_list
+ conf[:sites] = site_list
+ assert_equal(conf, run_command(["sites"], "config", "sites"))
+ end
+end
More information about the Swift-commit
mailing list