示例#1
0
void test_reverse_reverse(Range const& range, std::string const& expected)
{
    typedef typename bg::reversible_view<Range const, Direction1>::type rview1;
    typedef typename bg::reversible_view<rview1 const, Direction2>::type rview2;

    rview1 view1(range);
    rview2 view2(view1);
    test_option(view2, expected);
}
示例#2
0
void test_close_close(Range const& range, std::string const& expected)
{
    typedef typename bg::closeable_view<Range const, Closure1>::type cview1;
    typedef typename bg::closeable_view<cview1 const, Closure2>::type cview2;

    cview1 view1(range);
    cview2 view2(view1);
    test_option(view2, expected);
}
示例#3
0
void test_reverse_close(Range const& range, std::string const& expected)
{
    typedef typename bg::closeable_view<Range const, Closure>::type cview;
    typedef typename bg::reversible_view<cview const, Direction>::type rview;

    cview view1(range);
    rview view2(view1);
    test_option(view2, expected);
}
示例#4
0
void setoption_setalloptions_optionsset() {
  torque_driver_type * driver = torque_driver_alloc();
  test_option(driver, TORQUE_QSUB_CMD, "XYZaaa");
  test_option(driver, TORQUE_QSTAT_CMD, "xyZfff");
  test_option(driver, TORQUE_QDEL_CMD, "ZZyfff");
  test_option(driver, TORQUE_QUEUE, "superhigh");
  test_option(driver, TORQUE_NUM_CPUS_PER_NODE, "42");
  test_option(driver, TORQUE_NUM_NODES, "36");
  test_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "1");
  test_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "0");
  test_option(driver, TORQUE_CLUSTER_LABEL, "thecluster");

  printf("Options OK\n");
  torque_driver_free(driver);
}
示例#5
0
int main( int argc , char ** argv) {
  lsf_driver_type * driver = lsf_driver_alloc();

  test_option( driver , LSF_BSUB_CMD    , "Xbsub");
  test_option( driver , LSF_BJOBS_CMD   , "Xbsub");
  test_option( driver , LSF_BKILL_CMD   , "Xbsub");
  test_option( driver , LSF_RSH_CMD     , "RSH");
  test_option( driver , LSF_LOGIN_SHELL , "shell");
  test_option( driver , LSF_BSUB_CMD    , "bsub");
  printf("Options OK\n");

  test_server( driver , NULL , LSF_SUBMIT_INTERNAL );
  test_server( driver , "LoCaL" , LSF_SUBMIT_LOCAL_SHELL );
  test_server( driver , "LOCAL" , LSF_SUBMIT_LOCAL_SHELL );
  test_server( driver , "XLOCAL" , LSF_SUBMIT_REMOTE_SHELL );
  test_server( driver , NULL , LSF_SUBMIT_INTERNAL );
  test_server( driver , "be-grid01" , LSF_SUBMIT_REMOTE_SHELL );
  printf("Servers OK\n");

  test_status( JOB_STAT_PEND   , JOB_QUEUE_PENDING );
  test_status( JOB_STAT_PSUSP  , JOB_QUEUE_RUNNING );
  test_status( JOB_STAT_USUSP  , JOB_QUEUE_RUNNING );
  test_status( JOB_STAT_SSUSP  , JOB_QUEUE_RUNNING );
  test_status( JOB_STAT_RUN    , JOB_QUEUE_RUNNING );
  test_status( JOB_STAT_NULL   , JOB_QUEUE_NOT_ACTIVE );
  test_status( JOB_STAT_DONE   , JOB_QUEUE_DONE );
  test_status( JOB_STAT_EXIT   , JOB_QUEUE_EXIT );
  test_status( JOB_STAT_UNKWN  , JOB_QUEUE_EXIT );
  test_status( 192             , JOB_QUEUE_DONE ); 
  
  printf("Status OK \n");
  exit(0);
}
示例#6
0
int main(int argc, char *argv[]) {
        _cleanup_(sd_event_unrefp) sd_event *e;

        assert_se(sd_event_new(&e) >= 0);

        test_setup_logging(LOG_DEBUG);

        test_client_basic(e);
        test_option(e);
        test_option_status(e);
        test_advertise_option(e);
        test_client_solicit(e);

        return 0;
}
示例#7
0
int main(int argc, char *argv[]) {
        _cleanup_(sd_event_unrefp) sd_event *e;

        assert_se(sd_event_new(&e) >= 0);

        log_set_max_level(LOG_DEBUG);
        log_parse_environment();
        log_open();

        test_client_basic(e);
        test_option(e);
        test_advertise_option(e);
        test_client_solicit(e);

        return 0;
}
示例#8
0
int main(){

	int opt;
	print_menu();
	scanf("%d", &opt);
	while(opt > 0 && opt < 6)
	{
		test_option(opt);
		print_menu();
		scanf("%d", &opt);
	}
	if(opt == 0)
		puts("Terminado!");

	//test_option(1);
	return 0;
}
示例#9
0
文件: tmod.c 项目: Mellanox/arc_ltp
/*
 * tmod_ioctl:
 *      a user space program can drive the test functions
 *      through a call to ioctl once the correct file
 *      descriptor has been attained
 *
 * 	in user space the file descriptor that you attain
 * 	will represent the inode and file pointers in
 * 	the kernel ioctl function, and only 3 variables
 *	will be passed in, linux/ioctl.h should be
 *	included
 *
 */
static int tmod_ioctl(struct inode *ino, struct file *f,
                        unsigned int cmd, unsigned long l) {
	int 			rc;
	tmod_interface_t	tif;
	caddr_t			*inparms;
	caddr_t			*outparms;

	printk("Enter tmod_ioctl\n");

	inparms = NULL;
	outparms = NULL;
	rc = 0;

	/*
	 * the following calls are used to setup the
	 * parameters that might need to be passed
	 * between user and kernel space, using the tif
	 * pointer that is passed in as the last
	 * parameter to the ioctl
	 *
	 */
	if (copy_from_user(&tif, (void *)l, sizeof(tif))) {
                /* Bad address */
                return(-EFAULT);
        }

	/*
         * Setup inparms and outparms as needed
         */
        if (tif.in_len > 0) {
                inparms = (caddr_t *)kmalloc(tif.in_len, GFP_KERNEL);                if (!inparms) {
                        return(-ENOMEM);
                }

                rc = copy_from_user(inparms, tif.in_data, tif.in_len);
                if (rc) {
                        kfree(inparms);
                        return(-EFAULT);
                }
        }
        if (tif.out_len > 0) {
                outparms = (caddr_t *)kmalloc(tif.out_len, GFP_KERNEL);
                if (!outparms) {
                        kfree(inparms);
                        return(-ENOMEM);
                }
        }

	/*
	 * Use a switch statement to determine which function
	 * to call, based on the cmd flag that is specified
	 * in user space. Pass in inparms or outparms as
	 * needed
	 *
	 */
 	switch(cmd) {
		case LTP_OPTION1:	rc = test_option(); break;
		default:
			printk("Mismatching ioctl command\n");
                        break;
        }

	/*
	 * copy in the test return code, the reason we
	 * this is so that in user space we can tell the
	 * difference between an error in one of our test
	 * calls or an error in the ioctl function
	 */
	tif.out_rc = rc;
	rc = 0;

	/*
	 * setup the rest of tif pointer for returning to
	 * to user space, using copy_to_user if needed
	 */

	/* if outparms then copy outparms into tif.out_data */
        if (outparms) {
                if (copy_to_user(tif.out_data, outparms, tif.out_len)) {
                        printk("tpci: Unsuccessful copy_to_user of outparms\n");
                        rc = -EFAULT;
                }
        }

        /* copy tif structure into l so that can be used by user program */
        if (copy_to_user((void*)l, &tif, sizeof(tif))) {
                printk("tpci: Unsuccessful copy_to_user of tif\n");
                rc = -EFAULT;
        }

        /*
         * free inparms and outparms
         */
        if (inparms) {
                kfree(inparms);
        }
        if (outparms) {
                kfree(outparms);
        }

	return rc;
}