Example #1
0
def	config() :

	env.display(env.HEADER_OK, "checking k0", env.OPTION_NONE)
	env.display(env.HEADER_NONE, "", env.OPTION_NONE)
	env.display(env.HEADER_OK, "current configuration:", env.OPTION_NONE)
	env.display(env.HEADER_OK, "  reference path:         " + REF_PATH,
		    env.OPTION_NONE)
	env.display(env.HEADER_OK, "  tarballs path:          " + TAR_PATH,
		    env.OPTION_NONE)
	env.display(env.HEADER_OK, "  tests path:             " + TST_PATH,
		    env.OPTION_NONE)
	env.display(env.HEADER_OK, "  traces path:            " + TRC_PATH,
		    env.OPTION_NONE)
	env.display(env.HEADER_OK, "  temporary folder:       " + TMP_PATH,
		    env.OPTION_NONE)
	env.display(env.HEADER_NONE, "", env.OPTION_NONE)


	if os.path.exists(TMP_PATH) :
		env.display(env.HEADER_ERROR,
			    "`" + TMP_PATH + "' will be deleted",
			    env.OPTION_NONE)
		env.display(env.HEADER_NONE, "", env.OPTION_NONE)

	env.display(env.HEADER_INTERACTIVE,
		    "to cancel press CTRL^C, otherwise press enter",
		    env.OPTION_NONE)
	env.input(env.OPTION_NONE)

	return
Example #2
0
def                     Submit(server, capability, arguments):
  snapshot = None
  stage = None

  # warning
  Warning()

  # check the arguments
  if len(arguments) != 1:
    Usage()
    sys.exit(42)

  # retrieve the arguments.
  stage = arguments[0]

  # check if there is a 'snapshot.tar.bz2' in the client/ directory.
  if env.path(env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2",
              env.OPTION_EXIST):
    # display a message.
    env.display(env.HEADER_OK,
                "loading the snapshot '" +                              \
                  env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2'",
                env.OPTION_NONE)

    # read the snapshot.
    snapshot = env.pull(env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2",
                        env.OPTION_NONE)

    # warn the user.
    env.display(env.HEADER_NONE, "", env.OPTION_NONE)
    env.display(env.HEADER_INTERACTIVE,
                "are you sure you want the local snapshot to be submitted?",
                env.OPTION_NONE)
    env.display(env.HEADER_INTERACTIVE,
                "press CTRL^C to stop the script, ENTER to continue...",
                env.OPTION_NONE)
    env.input(env.OPTION_NONE)
  else:
    # display a message.
    env.display(env.HEADER_OK,
                "generating the kaneton snapshot",
                env.OPTION_NONE)

    # export the current kaneton implementation.
    env.launch(env._EXPORT_SCRIPT_,
               "test:" + capability["type"],
               env.OPTION_QUIET)

    # display a message.
    env.display(env.HEADER_OK,
                "loading the kaneton snapshot",
                env.OPTION_NONE)

    # read the snapshot.
    snapshot = env.pull(env._EXPORT_DIR_ + "/output/" +                 \
                          "test:" + capability["type"] + ".tar.bz2",
                        env.OPTION_NONE)

  # display a message.
  env.display(env.HEADER_OK,
              "requesting the server",
              env.OPTION_NONE)

  # submit the snapshot.
  ktp.xmlrpc.Call(server.Submit(capability,
                                ktp.miscellaneous.Binary(snapshot),
                                stage))

  # display a message.
  env.display(env.HEADER_OK,
              "the snapshot has been submitted successfully",
              env.OPTION_NONE)
Example #3
0
def                     Test(server, capability, arguments):
  snapshot = None
  suite = None
  environment = None
  identifier = None

  # warning
  Warning()

  # check the arguments
  if len(arguments) != 2:
    Usage()
    sys.exit(42)

  # retrieve the arguments.
  environment = arguments[0]
  suite = arguments[1]

  # check if there is a 'snapshot.tar.bz2' in the client/ directory.
  if env.path(env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2",
              env.OPTION_EXIST):
    # display a message.
    env.display(env.HEADER_OK,
                "loading the snapshot '" +                              \
                  env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2'",
                env.OPTION_NONE)

    # read the snapshot.
    snapshot = env.pull(env._TEST_CLIENT_DIR_ + "/snapshot.tar.bz2",
                        env.OPTION_NONE)

    # warn the user.
    env.display(env.HEADER_NONE, "", env.OPTION_NONE)
    env.display(env.HEADER_INTERACTIVE,
                "are you sure you want the local snapshot to be submitted?",
                env.OPTION_NONE)
    env.display(env.HEADER_INTERACTIVE,
                "press CTRL^C to stop the script, ENTER to continue...",
                env.OPTION_NONE)
    env.input(env.OPTION_NONE)
  else:
    # display a message.
    env.display(env.HEADER_OK,
                "generating the kaneton snapshot",
                env.OPTION_NONE)

    # export the current kaneton implementation.
    env.launch(env._EXPORT_SCRIPT_,
               "test:" + capability["type"],
               env.OPTION_QUIET)

    # display a message.
    env.display(env.HEADER_OK,
                "loading the kaneton snapshot",
                env.OPTION_NONE)

    # read the snapshot.
    snapshot = env.pull(env._EXPORT_DIR_ + "/output/" +                 \
                          "test:" + capability["type"] + ".tar.bz2",
                        env.OPTION_NONE)

  # display a message.
  env.display(env.HEADER_OK,
              "requesting the server",
              env.OPTION_NONE)

  # trigger a test.
  identifier = ktp.xmlrpc.Call(server.Test(capability,
                                           ktp.miscellaneous.Binary(snapshot),
                                           g_platform,
                                           g_architecture,
                                           environment,
                                           suite))

  # display the received report.
  env.display(env.HEADER_OK,
              "the snapshot has been scheduled for testing under the "  \
              "identifier: " + identifier,
              env.OPTION_NONE)